This shell script dosent give me any output:
GID="gmod01"
PID= screen -list | grep $GID | cut -f1 -d'.' | sed 's/\W//g'
echo $PID
Echo PID is empty, how can i fix this? I get 12055 out but it dosent copy in the value
Thank you
This shell script dosent give me any output:
GID="gmod01"
PID= screen -list | grep $GID | cut -f1 -d'.' | sed 's/\W//g'
echo $PID
Echo PID is empty, how can i fix this? I get 12055 out but it dosent copy in the value
Thank you
Use brackets.
GID="gmod01"
PID=$(screen -list | grep $GID | cut -f1 -d'.' | sed 's/\W//g')
echo $PID