0

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

jsherk
  • 607
  • 1
  • 7
  • 20
  • I guess you have an [XY Problem](http://meta.stackexchange.com/questions/66377/what-is-the-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 05 '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 05 '12 at 23:21
  • Automator did work: here was the other question: http://superuser.com/questions/397277/how-to-run-bash-profile-function-from-desktop-alias-command-file-on-osx-lion/397297 – jsherk Mar 08 '12 at 05:47

1 Answers1

1

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.

Jack
  • 250
  • 1
  • 2