Created
April 28, 2017 09:41
-
-
Save josteink/f63909659bf76231969291410c74b108 to your computer and use it in GitHub Desktop.
Screen glue
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
#!/usr/bin/env bash | |
~/bin/screen-create-or-attach ever-session weechat |
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
#!/usr/bin/env bash | |
SESSION_NAME=$1 | |
shift | |
ARGS=$* | |
SESSION_COUNT=`screen -ls $SESSION_NAME | grep $SESSION_NAME | wc -l` | |
if [ $SESSION_COUNT -eq 0 ] ; then | |
echo -n "No session found. Starting one..." | |
screen -dmS $SESSION_NAME $ARGS | |
echo " Done!" | |
fi | |
echo -n "Attaching to session..." | |
screen -Adr $SESSION_NAME | |
echo " Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment