Last active
December 22, 2015 00:19
-
-
Save rkaneko/6388137 to your computer and use it in GitHub Desktop.
Convert png to eps .
Requirements convert Unix command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dependencies | |
# + convert | |
SCRIPT_DIR=`dirname $0` | |
# If ./eps directory doesn't exist, make directory . | |
if [ ! -d ${SCRIPT_DIR}/eps ] | |
then | |
mkdir ${SCRIPT_DIR}/eps | |
fi | |
PNG_FILES=`ls | grep .png` | |
for PNG_FILE in ${PNG_FILES[@]} | |
do | |
LEN=${#PNG_FILE} | |
END=`expr ${LEN} - 4` | |
FILE_NAME=`echo ${PNG_FILE} | cut -c 7-${END}` | |
convert ${PNG_FILE} ${SCRIPT_DIR}/eps/${FILE_NAME}.eps | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment