On Wed, 12 Nov 2008 16:06:22 +0100
Christian Kellermann <[EMAIL PROTECTED]> wrote:

> -     find src \( -name \*.o -o -name \*.hi \) -exec rm -f {} +
> -     find src \( -name \*.p_o -o -name \*.p_hi \) -exec rm -f {} +
> +     find src \( -name \*.o -o -name \*.hi \) | xargs rm -f
> +     find src \( -name \*.p_o -o -name \*.p_hi \) | xargs rm -f

This is not strictly equivalent: when there are no matches, "rm -f" is
run without any argument.

  $ find . -name 'non-existing-fn' | xargs echo "CIAO"
  CIAO
  $
  
I see that GNU xargs accepts a --no-run-if-empty, but I bet that's yet
another extension.

  $ find . -name 'non-existing-fn' | xargs --no-run-if-empty echo "CIAO"
  $

hth,
ciao, lele.
-- 
nickname: Lele Gaifax    | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas    | comincerò ad aver paura di chi mi copia.
[EMAIL PROTECTED] |                 -- Fortunato Depero, 1929.
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to