I am not sure this is doable?
But i have 2 functions
do_get_array() {
getArray "/root/1.txt"
for e in "${array[@]}"
do
do_otherfunction $e
done
}
do_otherfunction() {
cmd="Print Me $e"
}
getArray() {
i=0
while read line # Read a line
do
array[i]=$line
i=$(($i + 1))
done < $1
}
echo "cmd"
SO, passing the parameter from 1 function to the other works.. but i am not sure how to loop until it the last $e in the array? Not sure i explained it correct. It Echo's out the 1st $e but the rest dont. it just stops.