Hi!
I have the following code :
Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then
echo "Wrong number of arguments"
exit $E_BADARGS
else
for file in TputAbort$1$2.dat
do
awk '{sum+=$1}END{print "throughput parallel: " sum/NR " op/s"}' $file
awk '{sum+=$2}END{print "abort parallel: " sum/NR " op/s"}' $file
done
fi
What I want to do is to use the arguments I pass to my shell script inside the AWK command. I would like to replace the string "parallel" by the first argument which would be $1. But of course, this $1 (the 1st argument) is not the same as the $1 I use in "sum+=$1" (which represents the first field in the file $file.
Anyone has an idea ?
Thanks in advance!