Created
September 4, 2013 10:33
-
-
Save d6rkaiz/6435320 to your computer and use it in GitHub Desktop.
tmuxでセッションの有無を判別して起動するスクリプト ref: http://qiita.com/d6rkaiz/items/993ef586aa39f2ddb588
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 | |
tmux ls > /dev/null | |
if [ $? -eq 1 -a -z "$TMUX" ]; then | |
exec tmux | |
elif [ -z "$TMUX" ] ; then | |
exec tmux attach | |
else | |
echo "sessions should be nested with care." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment