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
13 hours 31 min ago
18 hours 36 min ago
23 hours 38 sec ago
1 day 49 min ago
1 day 15 hours ago
1 day 15 hours ago
1 day 20 hours ago
2 days 2 hours ago
2 days 3 hours ago
2 days 4 hours ago