Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


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:… – jsherk Mar 8 '12 at 5:47
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .