Skip to content

Instantly share code, notes, and snippets.

@hackerain
Created February 13, 2014 05:29
Show Gist options
  • Save hackerain/8970225 to your computer and use it in GitHub Desktop.
Save hackerain/8970225 to your computer and use it in GitHub Desktop.
kill screen session
SCREEN_NAME=${SCREEN_NAME:-gring}
SCREEN=$(which screen)
if [[ -n "$SCREEN" ]]; then
SESSION=$(screen -ls | awk '/[0-9].'$SCREEN_NAME'/ { print $1 }')
if [[ -n "$SESSION" ]]; then
screen -X -S $SESSION quit
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment