Created
July 3, 2018 09:07
-
-
Save Digicrat/92e7313a93624544083810b687f41146 to your computer and use it in GitHub Desktop.
tmux script example
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 | |
SESSION=tmux_test | |
tmux -2 new-session -d -s $SESSION | |
# Setup Window 1 | |
tmux new-window -t $SESSION:1 -n 'Logs' | |
tmux split-window -h | |
tmux select-pane -t 0 | |
tmux send-keys "tail -f /var/log/lastlog" C-m | |
tmux select-pane -t 1 | |
tmux send-keys "echo 'Test Cmd'" C-m | |
# Setup a MySQL window | |
tmux new-window -t $SESSION:2 -n 'Emacs' 'emacs tmux_test.sh' | |
# Set default window | |
tmux select-window -t $SESSION:1 | |
# Attach to session | |
tmux -2 attach-session -t $SESSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment