roshnicse 0 Newbie Poster
Hi....below is my .csh file. In this foreach n, i have runned my algorithm 10 times. But now i want it to run(iterate) 1000 times. i.e. foreach seed(1 2 3 4 5 6 7 8 9 10 11 12......1000). I tried using awk'BEGIN{for(....);}'.But still its not working...please help.

foreach n( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
rm no_yes${no_yes}
end
rm iteration
printf "No. of SU  iterations\n ">> iteration
foreach n( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
foreach seed(1 2 3 4 5 6 7 8 9 10 )
./convergence ${n} ${seed} >> n${n}
}'
printf "%d\t" $n>>"iteration"
awk 'BEGIN{count=0;sum0=0}{sum0 +=$1;count++} END {avg0=sum0/count; printf "%0.2f\t \n",avg0}' n${n}>>iteration
}'

Inline Code Example Here