Skip to content

Instantly share code, notes, and snippets.

@otterley
Created January 18, 2012 23:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save otterley/1636372 to your computer and use it in GitHub Desktop.
Save otterley/1636372 to your computer and use it in GitHub Desktop.
tmux fanout
#!/bin/sh
# Usage: tmux-cssh user1@host1 user2@host2 host3 host4 host5 host6 [...]
SESSION=cssh-$$
tmux new-session -d -s $SESSION "exec ssh $1"
shift
for host in "$@"; do
tmux split-window -t $SESSION "exec ssh $host"
tmux select-layout -t $SESSION tiled >/dev/null
done
tmux set-window-option -t $SESSION status off >/dev/null
tmux set-window-option -t $SESSION synchronize-panes on >/dev/null
exec tmux attach -t $SESSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment