I have a working command. Now I need to know how to apply it to a bunch of files at once so as to automate the process. I tried the below commands and it didn't work. I'm trying to use Imagemagick convert command to perform an operation on 39 PNG files.
P.S. I could not make the code button work to wrap the code in code tags. Will someone please do so for me, thank you.
This command does nothing, just returns to a prompt.
find ./ -name '*.png'
find ./ -name '*.png' -exec sh -c 'convert "$1" -shave 50x50 -bordercolor white -border 1x1 -fuzz 70% -trim "/home/nate/Pictures/trim/${1##*/}"' sh {} \;
find ./ -name '*.png' -exec sh -c 'for f; do convert "$f" -shave 50x50 -bordercolor white -border 1x1 -fuzz 70% -trim "/home/nate/Pictures/trim/${f##*/}"; done' sh {} +
while IFS= read -r -d '' file; do filename=`basename "$file"`convert "$file" -shave 50x50 -bordercolor white -border 1x1 -fuzz 70% -trim "/home/nate/Pictures/trim/$filename" done < <(find ./ -name "*.png" -print0)
find . -iname '*.png'? – muru Oct 20 '16 at 13:27