in reply to yargs -- xargs but handle spaces in filenames
find ./ -type f -iname "*whatever*" -exec perlscript '{}' \;
Imagine you're using a db too, opening that connection can be expensive.
The following is an example that tells xargs that the delimiter is not the posix standard space, but the newline..
Find all files named jpg/JPG larger than one meg, store that to a text file:
find ./ -type f -iname "*jpg" -size +1M > /tmp/foundUse xargs (version 4.4.0 +), tell it the delimiter is a newline, pass this to mogrify to reduce size of files..
xargs --delimiter=\\n --arg-file=/tmp/found mogrify -resize 800x600
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: yargs -- xargs but handle spaces in filenames
by pingo (Hermit) on Jul 16, 2009 at 12:55 UTC | |
by ikegami (Patriarch) on Jul 16, 2009 at 14:39 UTC | |
by leocharre (Priest) on Jul 16, 2009 at 14:31 UTC | |
by pingo (Hermit) on Jul 16, 2009 at 14:46 UTC |