Guest User

Untitled

a guest
Jan 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ "$1" != "" ]; then
  4. cd $1
  5. fi
  6.  
  7. DIR_NAME=${PWD##*/}
  8.  
  9. tmux has-session -t $DIR_NAME 2>/dev/null
  10. if [ $? -eq 1 ]
  11. then
  12. tmux new -s $DIR_NAME
  13. else
  14. tmux attach -t $DIR_NAME
  15. fi
Add Comment
Please, Sign In to add comment