Tnx falko but I have decided to do it another and I have run into another problem, but hopefully some1 can help me out (I'll be tryin to fix it to)
Ok here it goes,
Let's say I have 5 variables
Code:
var1=...
var2=...
...
var5=...
And then I use each variable to run various parameters, for example:
Code:
op1=`cat $files | grep $var1`
op2=`cat $files | grep $var2`
... you get the point
What I have decided to do is to use a
for, because I always now the number of my variables and I can control it, and I am using this way
Code:
for (( i = 1; i <= 6; i++ ))
do
op$i=`cat $files | grep $var$i`
done
Everything ok till now, the problem comes when I extend the
for to fit my needs:
Code:
for (( i = 1; i <= 6; i++ ))
do
op$i=`cat $files | grep $var$i`
for op in $op$i
do
....
done
done
The blue underlined line is the 1 that give me trouble, I want it to do a
Code:
for op in op1
for op in op2
...
but by using the $i variable. I know that
op$i already contains
op1, op2, op3, op4 and op5 but how can I access it by not doing
$op$i?
Hope you understand my question (any1) and also able to help me out!
Recent comments
6 hours 53 min ago
11 hours 52 min ago
13 hours 18 min ago
14 hours 11 min ago
15 hours 54 min ago
20 hours 18 min ago
21 hours 10 min ago
23 hours 23 min ago
1 day 12 hours ago
1 day 14 hours ago