Skip to content

Instantly share code, notes, and snippets.

@dungnv53
Forked from marcusmoller/gist:6622766
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save dungnv53/2854fa95c7bc08a95b7f to your computer and use it in GitHub Desktop.

Select an option

Save dungnv53/2854fa95c7bc08a95b7f to your computer and use it in GitHub Desktop.
#!/bin/sh
for f in *.gif
do
short=${f:0:4}
if ls $short".png" &> /dev/null; then
echo "file exists"
else
montage -tile x1 -geometry +0+0 -background none $short*.gif $short.png
convert $short.png -transparent white $short.png
fi
done
@dungnv53
Copy link
Author

dungnv53 commented Sep 6, 2014

short=echo $f | sed -re 's/^(.{4}).+$/\1/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment