Saturday, April 27, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 8883  / 2 Years ago, fri, may 6, 2022, 5:21:30

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?


More From » command-line

 Answers
0

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' &

[#29088] Saturday, May 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cupwire

Total Points: 365
Total Questions: 126
Total Answers: 125

Location: Malaysia
Member since Thu, Feb 16, 2023
1 Year ago
;