Eric Kow <[email protected]> writes: > Only one left! > > On Mon, May 25, 2009 at 12:05:21 +0300, Dan Pascu wrote: >> > tests/optimize_relink.sh: echo 'use File::Basename; $res=0; while >> > ($fn=<'$1'/*>) { $fn2="'$2'/" . basename($fn); @fd1=lstat($fn); >> > @fd2=lstat($fn2); $res += ($fd1[1] != $fd2[1]);}; exit($res);' | perl > > In case any Perl hackers want to help us translate this to shell, or > maybe Haskell if need be: > > # succeeds if there are hard links > use File::Basename; > $res=0; > while ($fn=<'$1'/*>) { > $fn2="'$2'/" . basename($fn); > @fd1=lstat($fn); > @fd2=lstat($fn2); > $res += ($fd1[1] != $fd2[1]); > }; > exit($res); > > Ideas? Surely something like ls -l should help us do what we want?
It is always wrong to use ls(1) output programmatically. http://mywiki.wooledge.org/ParsingLs If we're lucky, stat(1) is part of POSIX. _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
