rohit264 rohit264 - 1 month ago 12
Bash Question

Linux shell scripting for different tabs

I want a script,which after executing will open multiple tabs and a specified command will run on every tab.Basically that command is ssh i.e. for connecting to other machines.

Answer

you can try something like this;

gnome-terminal --tab  --title "server1" -x bash -c "ssh -t user1@host1 'nohup yourCommand'" --tab  --title "server2" -x bash -c "ssh -t user2@host2 'nohup yourCommand'"