-
-
Save nivertech/7323995 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 -x | |
| N=$1; shift | |
| if [ -z "$N" -o -z "$1" ]; then | |
| cat <<_ | |
| Usage: $0 N COMMAND | |
| _ | |
| exit 1 | |
| fi | |
| S=s$$ | |
| tmux new-session -d -s $S "$*" | |
| # we start from 2 because we already have 1 pane | |
| for i in `seq 2 $N`; do | |
| tmux split-window -h -t $S "$*" | |
| tmux select-layout tiled | |
| done | |
| tmux select-pane -t .0 | |
| tmux at -t $S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment