On Sat, Nov 24, 2007 at 11:20:46PM +0100, arno renevier wrote: > as there is no binary file in python-doc, dlocate -lsbin is just transformed > in "ls -1" > why not use something like : > > for f in `dlocate -L $PKG`; do > # file is executable, regular, and not a symlink > if [ -x $f -a -f $f -a ! -h $f ]; then > ls -1 $f > fi > done > > instead of xargs ?
doing lots of stats and lots of calls to 'ls' rather than just a grep | xargs seems like an anti-optimisation to me. not that speed is a huge issue here, but it just seems wrong to me to deliberately do something the slow way. a better/easier fix will be to use the --no-run-if-empty ("-r") xargs option. (i'm pretty sure this used to be the default behaviour of xargs. whatever, it's not now) in fact, i'll use 'xargs -r' wherever it makes sense to do so in the rest of dlocate. i've also changed numerous tests for "file exists" ('-e') to "file exists and is not empty" ('-s'). this works in my dev version of dlocate (which has a few other minor fixes). i'll upload soon. craig -- craig sanders <[EMAIL PROTECTED]> The only excuse for God is that he doesn't exist. -- Stendhal -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]