Skip to content

Instantly share code, notes, and snippets.

@lapo-luchini
Last active February 18, 2023 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lapo-luchini/480603c24ee2c5d3eb700f3cbce81083 to your computer and use it in GitHub Desktop.
Save lapo-luchini/480603c24ee2c5d3eb700f3cbce81083 to your computer and use it in GitHub Desktop.
Open a few `tmux` tabs with specific name and commands
#!/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