Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: yargs -- xargs but handle spaces in filenames

by pingo (Hermit)
on Jul 16, 2009 at 12:55 UTC ( #780697=note: print w/replies, xml ) Need Help??


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 (Pope) 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 + {} \;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://780697]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-11-28 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?