I'm trying discover if any linux screen session is running. Currently, I have the code for only a specific screen by name, but I want discover if any screen session is running. Can you help me?
screen -list | grep "SESSİON NAME" && echo "Active Program" || echo "Passive Program"
How can I update this code above to match all screens running?
Just grep for the proper string:
if screen -list | grep "No active:"; then echo "No active Program"; else echo "There is an active Program"; fi