i am running a script in a ksh93 shell that appears to cross its 'input variables' when the script runs twice at the same time. is there a way to prevent this? i need it to run simultaneously... here are some clips;
#!/usr/bin/ksh93
# Seperate file path and first search argument.
logpath="/usr/work/wms/backup"
timestmp=`date +'%m%d%C%y%H%M%S'`
maxgrab="$1"
shift 1
arglength=$(echo "$1"|awk -F "/" '{print NF}')
argpath=$(echo "$1"|cut -f -$((arglength - 1)) -d "/"
argbackup="$(echo "$1"|cut -f -$((arglength - 2)) -d "/"
/backup"
argone=$(echo "$1"|cut -f ${arglength} -d "/"
shift 1
args="${argone} $@"
echo "$timestmp $maxgrab $arglength $argpath $argbackup $argone $args " >> /usr/log/GCS2.log
and some log output;
ok-
10302003063037 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ia ia iman isc
ok-
10302003063037 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ir ir
ok-
10302003063138 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup lr
lost vars, time variable munched and path-
10302003063538 2000 8
302003063538 /backup iman isc
8
lost time var mixup-
302003063538 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ir ir
any help appreciated...
#!/usr/bin/ksh93
# Seperate file path and first search argument.
logpath="/usr/work/wms/backup"
timestmp=`date +'%m%d%C%y%H%M%S'`
maxgrab="$1"
shift 1
arglength=$(echo "$1"|awk -F "/" '{print NF}')
argpath=$(echo "$1"|cut -f -$((arglength - 1)) -d "/"
argbackup="$(echo "$1"|cut -f -$((arglength - 2)) -d "/"
argone=$(echo "$1"|cut -f ${arglength} -d "/"
shift 1
args="${argone} $@"
echo "$timestmp $maxgrab $arglength $argpath $argbackup $argone $args " >> /usr/log/GCS2.log
and some log output;
ok-
10302003063037 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ia ia iman isc
ok-
10302003063037 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ir ir
ok-
10302003063138 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup lr
lost vars, time variable munched and path-
10302003063538 2000 8
302003063538 /backup iman isc
8
lost time var mixup-
302003063538 2000 8 /usr/sap/work/wms/import/inv /usr/sap/work/wms/import/backup ir ir
any help appreciated...