in reply to Re: yargs -- xargs but handle spaces in filenames
in thread yargs -- xargs but handle spaces in filenames

Same thing, slightly more convoluted (and I'm not sure it works outside bash):

xargs --delimiter=\\n --arg-file=<(find ./ -type f -iname "*jpg" -size + +1M) mogrify -resize 800x600

Replies are listed 'Best First'.
Re^3: yargs -- xargs but handle spaces in filenames
by ikegami (Patriarch) on Jul 16, 2009 at 14:39 UTC
    leocharre pointed out that <() is overkill here, but it's very useful elsewhere, such as with diff:
    diff -u <( perl version1.pl 2>&1 ) <( perl version2.pl 2>&1 )
Re^3: yargs -- xargs but handle spaces in filenames
by leocharre (Priest) on Jul 16, 2009 at 14:31 UTC
    find ./ -type f -iname "*jpg" -size +1M | xargs --delimiter=\\n mogrif +y -resize 800x600

    Edit by tye to replace PRE tags with CODE tags

      --exec is still my preference, though (looks a bit nicer, imho, and no risk of the argument list being too long in case you just pipe everything and the kitchen sink to it):

      find ./ -type f -iname "*jpg" -size +1M --exec mogrify -resize 800x600 + {} \;