To some degree, I think it depends whether you need to determine whether screen is running, or whether a specific
screen session is running. Clearly your version of
screen doesn't provide any help via the return value. Your recourse then is to parse the output of 'screen -ls'. What kind of parsing you do would be reflected in your objectives. A simple version might be:
Code:
screen -ls | grep 'No Sockets'
to see if any sessions exists for your UID. More elaborate schemes can be used to re-attach to a specified screen name.
--- rod.