AlbertAguirre
Programmer
# i set my variable here
thisvar="abc"
echo $thisvar
# i go into my loop here and reset the variable
ls -l |
while IFS=":" read f1 f2
do
thisvar="xyz"
done
# display the supposed reset variable here
echo $thisvar
The result should be xyz but it remains abc
Why???
How can change the variable within the loop???
thisvar="abc"
echo $thisvar
# i go into my loop here and reset the variable
ls -l |
while IFS=":" read f1 f2
do
thisvar="xyz"
done
# display the supposed reset variable here
echo $thisvar
The result should be xyz but it remains abc
Why???
How can change the variable within the loop???