Page 1 of 1

Posted: 2006-07-13T15:25:10-07:00
by el_supremo
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

Posted: 2006-07-13T20:10:00-07:00
by anthony
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

Posted: 2006-07-14T13:50:41-07:00
by glennrp
Use

Code: Select all

for image in *.jpg
not

Code: Select all

for image in ls *.jpg
which expands to

Code: Select all

ls
file0.jpg
...
fileN.jpg
and then cannot find the file called "ls".

Posted: 2006-07-16T18:05:56-07:00
by anthony
To remove the instances of things like thumbnail.jpg use

Code: Select all

for image in *.jpg
in
  case "$image" in
  *.thumbnail.jpg) continue ;;
  esac
  ...
done
The case will have the script ignore the file names that matched.

For a recursive 'find' method use

Code: Select all

find . -type f -name '*.jpg' \! -name '*.thumbnail.jpg' | xargs ....