From 32d0eea3ddaa7133b696308407b3dcf3170cd027 Mon Sep 17 00:00:00 2001 From: Kamil Bugajski Date: Thu, 16 Aug 2012 21:06:52 +0200 Subject: [PATCH] switch -k funktioniert --- bin/generationlib | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/generationlib b/bin/generationlib index 6f860b2..7bf8468 100755 --- a/bin/generationlib +++ b/bin/generationlib @@ -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