Basically I'm trying to write a script that is going to run a program with some different arguments and collect some data from it. here's what i have so far...
Code:
for (( i = 1; i <= 20; i++ )) ### Outer for loop ###
do
ns lantest.tcl $i 1000 1
for (( j = $i ; j >= 0; j-- )) ### Inner for loop ###
do
grep '^r [0-9]\.[0-9]* $i 0' out | wc -l
done
done
The statement: "grep '^r [0-9]\.[0-9]* $i 0' out | wc -l" works if i substitute the actual numbers, but doesnt want to work with the variables. This is my main problem that I need to fix and I would greatly appreciate it if someone could help me.
I could also use some suggestions for how I should go about processing the data. That grep/wc is goin to return a number of lines, but I need to do computation on it. Should I send output to a file or a variable?
I need to have a table with the value $i followed by the value returned from the grep/wc command mulitpied by 1000. I want there to be one line for each value of $i.
Thanks in advance for anyone who can help me out!