Ubuntu – How to launch a terminal from script and another script to run in terminal

bashcommand linegnome-terminalscripts

I run a script when I log in that basically looks like this:

chromium-browser &
xchat &
cd ~/randomdir && gnome-terminal &
qbittorrent &

On the third line (cd ~/randomdir && gnome-terminal &), I would like to run another script in the terminal that I'm opening up. How can I do that in this script?

Best Answer

Run a non-interactive shell that runs your script and then replaces itself with an interactive bash shell.

gnome-terminal --working-directory="$HOME/randomdir" -x bash -c './randomscript; exec bash' &