You are not logged in.
Pages: 1
I have a function inside a while loop, and this function needs use a value from the last run. I tried to export it, but it isn't working.
Doing some testing I found that this exports the variable:
func(){
export var=`date +%N`
}
while :; do
func
echo $var
done
but how I used doesn't:
func(){
echo $var
export var=`date +%N`
}
while :; do
echo `func`
done
How could I use the second sintax and export the variable?
Last edited by hack.augusto (2008-11-13 01:34:39)
Offline
I just want the variable at the script scope, but declare it in the script scope isn't working also.
Offline
Pages: 1