Skip to content

Instantly share code, notes, and snippets.

@reyoung
Created May 8, 2012 04:08
Show Gist options
  • Save reyoung/2632502 to your computer and use it in GitHub Desktop.
Save reyoung/2632502 to your computer and use it in GitHub Desktop.
This script convert all jpg,png,bmp files in current path to eps files.
#!/bin/bash
# @abstract This script convert all jpg,png,bmp files in current path to eps files.
# 这个脚本可以将本目录的所有jpg,png,bmp转换成eps文件。
# @note The bmeps command must exist and in system PATH.
# 必须在系统中有bmeps命令,如果按照完整版CTex,就已经存在了。
# @author reyoung <[email protected]>
ConvertExt()
{
ext=$1
flist=`ls *$ext`
echo "Converting *$ext To eps"
for fn in $flist
do
echo "Converting $fn"
bmeps -c $fn `basename $fn $ext`.eps
done
}
ConvertExt ".jpg"
ConvertExt ".png"
ConvertExt ".bmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment