Skip to content

Instantly share code, notes, and snippets.

@m-manu
Last active November 28, 2016 06:03
Show Gist options
  • Save m-manu/bc874b93913970b52f29 to your computer and use it in GitHub Desktop.
Save m-manu/bc874b93913970b52f29 to your computer and use it in GitHub Desktop.
GNU Screen: in and out (only one screen)
#!/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