I have the following problem to be solved:
I read a .csv file (tempfile), fetch the values into variables F1 to F5.
Variables F1, F2, F3 are parameters used for running a program (blablaprogram).
Variable F4 I want to use to store the PID-value in and variable F5 is used for storing the return value of the wait-process.
I want to distinquish the several parallel processes and monitor if they are finished. Problem is that I cannot store the PID into variables and read the content of the variable. At the line : echo "\n\t`date`:\t$F4 ........ , $F4 contains the variablename that has been read from the flatfile i.o. the PID.
Has anyone a suggestion?
The code (KSH) is shown underneath:
IFS=","
while read F1 F2 F3 F4 F5
do
blablaprogram $F1 $F2 > $LOGDIR/bes006_$F3.log 2>&1 &
set $F4=$!
echo "\n\t`date`:\t$F4 is Process ID for job waiting on $F1$F2"
wait $F4 # Wait until background process $F4 completes ...
set $F5=$?
echo "\n\tPID $F4: blabla Return Value for $F1$F2 concatination is: $F5"
case $F5 in
0) echo "\n\tConcatination on $F1$F2 COMPLETED Successfully"
;;
1) echo "\n\t!!! WARNING: Likely DATA ERROR ... !!!"
;;
2) echo "\n\t!!! FATAL ERROR ... !!!"
ERRORS=10; exit $ERRORS
;;
esac
echo "\n\t*********************************************************************"
done < $TEMPFILE
IFS=" "