-
-
Save m-manu/bc874b93913970b52f29 to your computer and use it in GitHub Desktop.
GNU Screen: in and out (only one screen)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$TERM" = "screen" ]; then | |
echo "Sorry, you're already inside a screen" | |
elif [ `screen -D | wc -l` -eq 1 ]; then | |
echo "Launching new screen..." | |
/usr/bin/screen | |
else | |
echo "Resuming previous screen..." | |
/usr/bin/screen -D -x | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment