Ubuntu Linux – Detatching Program from Terminal – Bash Script

Here’s a quick and dirty Linux tip that I always wanted to do, but never figured out until today: If you want to close a terminal after opening a program via a script, you can do so with the “disown” command.

[bash]
sudo bash ~/Software/smartgit/bin/smartgit.sh & disown
[/bash]

This way, after your terminal completes opening the script, it relinquishes any control of the program allowing you to close the terminal without affecting the program. I suppose if you wanted actually close the program you could add an “exit” at the end of the script:

[bash]
sudo bash ~/Software/smartgit/bin/smartgit.sh & disown & exit
[/bash]




Leave a Reply

Your email address will not be published. Required fields are marked *