Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If you have a .command file on your desktop containing say a Terminal command that it runs when you double click it, is there anyway to either (1) prevent the window that pops open when you run it, or (2) close the window automatically when the process is complete?

Thanks

share|improve this question
    
I guess you have an XY Problem and actually just want your Firefox launching script to work in the background, is that correct? :) — the question is if you still need an answer for this question then. –  slhck Mar 5 '12 at 23:12
    
@slhck Yes that is correct. If using automator in my other question works, then I really do not need an answer to this one. Although could this still be a valid question that somebody else may want answered? I am actually curious now if this is possible even if I don't need to use it! Thanks –  jsherk Mar 5 '12 at 23:21
    
Automator did work: here was the other question: superuser.com/questions/397277/… –  jsherk Mar 8 '12 at 5:47

1 Answer 1

up vote 1 down vote accepted

I'm not sure about running it 'in the background', but it's possible to close the window after the execution is complete, as said here: How do I close the Terminal in OSX from the command line?

Just open Terminal and go to Terminal > Preferences > Settings > Shell: > When the shell exits: -> Close if the shell exited cleanly

Then just add exit; at the end of your file.

share|improve this answer
    
@"Jack BeePee" Thanks... that's good to know! –  jsherk Mar 8 '12 at 5:45

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.