I'm trying to write a script which launches a Gnome terminal and runs multiple commands. It's used to log serial data through an USB and my final goal is to produce a script which opens several COM ports each on a different shell. All shells must execute:
sudo script /logs/deviceX.log sudo picocom /dev/ttyUSB0 -b 115200 -p o | ts "%Y-%b-%d %H:%M:%S10"
and leave the shell running. I've verified the commands work ok when entered straight to a terminal so I tried creating an
openPort script with the 2 commands and used
gnome-terminal -x bash -c "./openPort; exec bash"
but the terminal only executes the first command and not the second.
I then tried creating a separate script for each command and used
gnome-terminal -x bash -c "./openPort1; ./openPort2; exec bash"
but I still get the same result.
Is it simply a syntax problem or am I doing something completely wrong?