Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 15 lines (14 sloc) 497 Bytes
#!/bin/sh
if [ "a" != "a$1" ]; then
OK="0"
for host in $(egrep '^host' ~/.ssh/config | grep -v '\*' | pcregrep -o "\s+$1\S*?(\s|$)")
do
OK="1"
STYLE=$(pcregrep -A1 "\s$host(\s|$)" ~/.ssh/config | grep -o 'tmux-style: .*' | cut -d' ' -f2-)
tmux send-keys "ssh $host" \; select-pane -P "$STYLE" \; split-window \; select-layout tiled
done
if [ $OK = "1" ]; then
tmux set-window-option synchronize-panes \; send-keys ENTER
tmux kill-pane \; select-layout tiled
fi
fi