I have a command line problem – probably a pretty easy one, but it seems I can't enter the right words into google.
So I want to resize all *.png images in the folder using imagemagick – this would be something like "convert -resize 80% " and I want "filename" → "small_filename"
So I tried:
for f in *.png ; convert -resize 80% "$f" "small_$f" ; done
but "syntax error near unexpected token `convert" – I suppose you can't just import imagemagick commands into the bash ?
I would be delighted if you could help.
Best Answer
You missed
do
afterfor ...
string. Here is a slightly modified script, but your version will work also if you adddo
missing in there.A name changing here works as follows: for every
$f
as a text string find its.png
part and change it for-80%.png