Hi,
Here is my code,
ids=(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 90 100 110 120)
for ((i=0;i<${#ids};i++)); do
awk '{ print ${ids[${i}]}" "$1; }' > ${TMP} < ./results/$1${ids[${i}]}/test_error.dat
done
I got this error
awk: { print ${ids[${i}]}" "$1; }
awk: ^ syntax error
awk: { print ${ids[${i}]}" "$1; }
awk: ^ syntax error
awk: fatal: invalid subscript expression
if I changed awk to gawk, I will get this error
gawk: {print ${ids}" "$1;}
gawk: ^ syntax error
gawk: {print ${ids}" "$1;}
gawk: ^ syntax error
Could you please explain what mistake I made? THanks a lot!