Create a script by your favorite method, e.g. right-click on your desktop > Create Document > name it 'test.sh' > Right click on the document > Properties > Permissions > Allow executing (or use chmod from terminal)
Open it for editing with gedit
, KWrite
, vt
etc.
Here is a script which will run some commands in the parent terminal, run two more commands in a child terminal, and leave both terminals open!
#!/bin/bash
echo hello
# open a child window, run two commands in it, and leave the child window open
mate-terminal -e "bash -c \"echo foo; echo bar; exec bash\""
echo "keep this open"
# leave the parent window open
read
Save the file, click and select "Run in Terminal."
An alternate way to keep the terminal windows from closing is:
Open a terminal > Edit menu > Profile Preferences > Title and Command > When Command Exits > Change from "Exit the terminal" to "HOLD THE TERMINAL OPEN"
Line 4 in the script is thanks to
Avoid gnome-terminal close after script execution?