Last active
February 18, 2023 17:43
-
-
Save lapo-luchini/480603c24ee2c5d3eb700f3cbce81083 to your computer and use it in GitHub Desktop.
Open a few `tmux` tabs with specific name and commands
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/sh | |
awk -F"\t" -vq="'" '{ | |
t=system("tmux new-window -n " q $1 q) | |
system("tmux send-keys -t " q t q " " q $2 q " C-m") | |
}' <<EOF # commands can contain ", but avoid ' and tabs | |
tab1 echo command on tab 1 | |
tab2 echo command on tab 2 | |
tab3 echo tab 3 ; echo "tab 3 cmd 2" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment