I need to run a script which will run many similar commands inside another terminal window (which has a app launched and ready to receive commands).
And the command should be sent to the open terminal that has the app but inside the loop, a new terminal window opens up every time, instead of the commands to be sent to the app in the first terminal.
So far I'm here:
#!/bin/bash
echo "Let's see what we can do";
gnome-terminal -e "./launch.sh";
sleep 3s;
#launched the app which needs to recieve the commands
number=0
while [ "$number" -lt 2 ]
do
number=`expr $number + 1 `;
gnome-terminal -e "sample_command -i" "$number";
done
echo "finished";
0 Answers