switch -k funktioniert

This commit is contained in:
Kamil Bugajski
2012-08-16 21:06:52 +02:00
parent 5a5c5f36eb
commit 32d0eea3dd
+7 -3
View File
@@ -9,6 +9,7 @@ Usage: `basename $0` [-h] [-i] [-j nb_jobs] command arg_list
-h Shows this help
-c give the path to the cfg file
-i give the path of the svg files without the last /
-k chek if the jpg already exist
-j Set number of simultanious jobs. Default is 2
-o directory where the files should be moved to after creation.
Default ist PICCREATE_OUT
@@ -114,12 +115,14 @@ if [ $# -eq 0 ]; then # must be at least one arg
exit 1
fi
while getopts "j:i:k:o:hc:" OPT; do # "j:" waits for an argument "h" doesnt
CHECKFILE=0
while getopts "j:i:kc:o:hc:" OPT; do # "j:" waits for an argument "h" doesnt
case $OPT in
h) echo "$USAGE"
exit 0 ;;
j) MAX_NPROC=$OPTARG ;;
k) CHECKFILE=$OPTARG ;;
k) CHECKFILE=1 ;;
c) CFG_FILENAME=$OPTARG ;;
o) OUTDIR=$OPTARG ;;
i) INPUT_FILENAME=$OPTARG ;;
@@ -137,10 +140,11 @@ echo $INPUT_FILE
for i in `ls $INPUT_FILE| grep .svg `
do
echo $i
echo $CHECKFILE
ID=`echo "$i" | sed -e 's/;.*//g'`
PIC_NAME=`echo "$i" | sed -e 's/.svg/.jpg/g'`
FILE_PATH=$INPUT_FILE/$PIC_NAME
if [ -s $FILE_PATH ]
if [ -s $FILE_PATH ] && [ $CHECKFILE -eq 1 ]
then
echo $PIC_NAME exists!
else