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
  • 667

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