i am working on ksh in Sun Solaris. i have a file having only one word as job names per line. want to read all the jobs from the file and execute them one by one in the given orde. how to do it in ksh. the below code works fine if fired on the command prompt. when i try to run it through shell script it gives error.
i=0;nawk '{print $1}' input.txt | while read -r r;
do
a[i]="$r";
echo "${a[++i]}";
done
ERROR:
i=0
+ read -r r
+ nawk {print $1} input.txt
test2.ksh: -r: is not an identifier