I'm trying to find out whether there is a Screen running or not with a function. To make it more simple ive written a little test script:
#! /bin/bash
function status()
{
if [ $a==1 ]
then
echo 1
else
echo 0
fi
}
a=1
echo $(status)
a=0
echo $(status)
status
if [ $(status)==0 ]
then
echo "Success"
else
echo "Fail"
fi
The Output is: 1;1;Sucess
But it should be: 1;0;Sucess
What am I doing wrong?
thanks alot, chrys