I would like the get the content of variable outside the while loop using shell script
For example:
::
count = 5
while [ @count -gt 0]; do
a=3
b=4
if ( a > b)
result = "UP"
else
result = "DOWN"
fi
count=$[ $count - 1]
done
echo $result
$result
appears empty every time!
I just want the content of result outside the loop.
Can anyone help on this issue! I know that the variable inseide the loop is executed in sub-shell, but I tried several tips and doesn't works!
Thanks in avdance