For a certain task, everytime I have to open 10 bash terminals and write different commands on them. Any way to automate this ?
I am running Fedora linux.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Just create a shell script which spawns those terminals and executes your commands upon startup. For example, with gnome-terminal you could do
#!/bin/bash gnome-terminal -e your_command1 & gnome-terminal -e your_command2 & gnome-terminal -e your_command3 & gnome-terminal -e your_command4 &
(and so on...)
EDIT: Removed unnecessary nohup command since it wasn't needed in this case. My original idea was to include nohup so the spawned gnome-terminal windows would not get killed in case the window where the script was started would be closed. It appears that those launhed terminal windows will stay alive just fine even without nohup.
There is already an answer which gives a straight forward solution to your problem, but if you one day want to do more advanced GUI automation stuff, I can highly recommend Sikuli.