I have tried to write a shell script to run multiple commands in multiple terminals, but I am not able to run the commands. I can only open multiple terminals.
This is written in a shell script file sitl.sh
:
#!/bin/bash
gnome-terminal --working-directory=/home/mit/catkin_ws/ && roslaunch iq_sim iris.launch && rosrun iq_gnc square
gnome-terminal --working-directory=/home/mit/ardupilot/ArduCopter/
gnome-terminal --working-directory=/home/mit/catkin_ws/
gnome-terminal --working-directory=/home/mit/catkin_ws/ && roslaunch iq_sim lidar.launch
If I run this script, the commands are executing in the same terminal. If I terminate the first command, the next command is running, if I terminate the second command, third command is running. I need to run all commands at a same time. I need to run each command in each terminal window at a same time using single shell script command. Kindly help me to resolve this issue.
My aim of the output is, need to run multiple commands, commands should execute separately in each terminal at a same time, I don't need to terminate first command, so that my second command will work.
Please, help me friends to resolve my issue.