Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In particular, I created a script to start Firefox which I double-click and choose 'Run in terminal,' but when the shell exits Firefox is killed immediately.

How do I prevent this from happening?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

You need to put the nohup before the command that launch firefox, so it needs to looks like that:

>$ nohup firefox

share|improve this answer
    
Also executing bashrc in your script can set environment variables needed by Firefox or other programs. –  Garrett Hall Nov 30 '11 at 14:42
    
You can also use disown, a bash internal to achieve the same thing. This wont redirect output like nohup will but it can be used to orphan any long running jobs you started without the likes of nohup and you want to keep them running after you leave. –  Matthew Ife Nov 30 '11 at 18:38
add comment

Also Make sure you execute firefox as a background job and not as a front running since the shell is parent and is waiting for the firefox to run and exit before the prompt is to be returned.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.