I'm calling a function that contains a variable defined within a while loop, but it is not being recognized. An example would be:
#!/bin/ksh
list=list_${F}.txt
.
.
.
function () {
if [ -f ${list} ]; then echo ${list} does not exist; fi
}
.
.
.
set `cat other_list.txt`
while :
do
for F
do
function
done
done
The result if you echo $list is list_.txt (The $F is not recognized).
The contents of other_list.txt is a and b, so the loop should look for list_a.txt and then list_b.txt.
What did I screw up?
#!/bin/ksh
list=list_${F}.txt
.
.
.
function () {
if [ -f ${list} ]; then echo ${list} does not exist; fi
}
.
.
.
set `cat other_list.txt`
while :
do
for F
do
function
done
done
The result if you echo $list is list_.txt (The $F is not recognized).
The contents of other_list.txt is a and b, so the loop should look for list_a.txt and then list_b.txt.
What did I screw up?