Skip to content

Instantly share code, notes, and snippets.

@kazoo0217
Created September 8, 2014 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazoo0217/a0bbc41e34081a7b1298 to your computer and use it in GitHub Desktop.
Save kazoo0217/a0bbc41e34081a7b1298 to your computer and use it in GitHub Desktop.
#!/bin/bash
# コマンド実行結果を変数に格納するには$(command ...)か`command ...`
ft1=.png
ft2=.jpg
w=100
for F in *$ft1
do
F1=$(echo $F)
F2=`echo $F1 | sed -e "s/$ft1/$ft2/g"`
echo convert -resize $w"x" $F1 $F2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment