I wrote this script to create multiple tabs in the same terminal window and run commands in them:
#!/bin/bash
#Use the commands as:
#--tab-with-profile=Default --title=<SPECIFY THE TAB TITLE HERE> -e "bash -ic \"<SPECIFY THE COMMAND YOU WANT TO RUN HERE>; bash\"" \
#The ampersand in the end of this file makes sure that the gnome-terminal command is run as a background process
echo "Setting up simulator environment";
service mysqld start;
gnome-terminal \
--tab-with-profile=Default --title=PROG1 -e "bash -ic \"clear;ls;./prog1; bash disown\"" \
--tab-with-profile=Default --title=SIMULATOR -e "bash -ic \"clear;ls;./simulator; bash disown\"" \
--tab-with-profile=Default --title=PROG2 -e "bash -ic \"clear;ls;./prog2; bash disown\"" \
--tab-with-profile=Default --title=DATA -e "bash -ic \"./data -f \"/home/user/NetBeansProjects/data3.txt\" -p \"6785\"; bash disown\"" \
--tab-with-profile=Default --title=PROG3 -e "bash -ic \"cd /home/user/NetBeansProjects/simulator;./prog3; bash disown\"" \
&
Problem is, when any of those programs finish running or if I press Ctrl+c to stop any of those programs, the tab closes. I don't want the tab to close. I want the tab to remain open and the bash terminal to be shown so that I can run some other command in the tab. Is there a way to make that happen?