Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#! /bin/bash
#set -ex
SOURCE_FILE=$1
FILE_NAME=`basename $1`
DISTNATION_FILE=`dirname $1`/${FILE_NAME%.*}_o.pdf
LANG=C
LC_ALL=C
## Check Value
if [ $# -ne 1 ]; then
echo -e "wrong value! \n Please Set ( Command [PDF Name] )"
exit 1
fi
## Check PDF File
if [ ${SOURCE_FILE: -4} != ".pdf" ]; then
echo "${SOURCE_FILE: -4}"
echo "Set File is wrong! Please set PDF File"
exit 2
fi
## Duplicate File
echo "test :${SOURCE_FILE: -4}"
echo "Source File : ${SOURCE_FILE}"
echo "Distnation File : ${DISTNATION_FILE}"
cp ${SOURCE_FILE} ${DISTNATION_FILE}
## Convert File
sed -i '' s'|/Registry (Adobe) /Ordering (Japan1) /Supplement [0-9]|/Registry(Adobe) /Ordering(Identity) /Supplement 0|g' ${DISTNATION_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment