I'm pretty sure the problem lies with the quotes that you use in the for statement. You've used the normal quote character whereas I think you need back-quotes:
for image in `ls *.jpg`
Best Wishes
Pete
Need to Batch .JPG Modify - Linux
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
A number of methods, are listed at the end of a description of the mogrify command in IM examples. I just added the above advanced xargs simpification, to that section
mogrify examples...
http://www.cit.gu.edu.au/~anthony/graph ... ogrify_not
mogrify examples...
http://www.cit.gu.edu.au/~anthony/graph ... ogrify_not
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Use
not which expands to
and then cannot find the file called "ls".
Code: Select all
for image in *.jpg
Code: Select all
for image in ls *.jpg
Code: Select all
ls
file0.jpg
...
fileN.jpg
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
To remove the instances of things like thumbnail.jpg use
The case will have the script ignore the file names that matched.
For a recursive 'find' method use
Code: Select all
for image in *.jpg
in
case "$image" in
*.thumbnail.jpg) continue ;;
esac
...
done
For a recursive 'find' method use
Code: Select all
find . -type f -name '*.jpg' \! -name '*.thumbnail.jpg' | xargs ....
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/