Last active
June 19, 2019 18:47
-
-
Save AICDEV/cf1497793bb1c27cb9b94d56c209ad6f to your computer and use it in GitHub Desktop.
If you want to start multiple session in tmux with shell scripting. Tmux, shell script, shell
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
# just for test and show case | |
mkdir test_1 test_2 | |
echo "current tmux sessions" | |
tmux ls | |
echo "kill all tmux sessions" | |
tmux kill-server | |
declare -a directories=("test_1" "test_2") | |
for i in "${directories[@]}" | |
do | |
cd ${i} | |
pwd | |
tmux new -d -s ${i} "ls -la" | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment