Reputation: 7769
I'm trying to execute a command line on each .jpg file in folder:
for i in ls *.jpg; do convert $i -resize 400x511 -gravity center -background white -extent 400x511 $i; done
But only the first .jpg is "done", what is wrong ?
Upvotes: 2
Views: 2292
Reputation: 785761
First of all you don't need ls
here and 2nd you need to quote it.
for i in *.jpg; do
convert "$i" -resize 400x511 -gravity center -background white -extent 400x511 "$i"
done
Upvotes: 1