1

when i execute some command file or shell file after execution terminal remains open and its not look appropriate i want to close the terminal by script without changing settings manually in MAC please help..

  • 1
    Have you tried using the Automator application? – David Anderson Apr 3 at 8:12
  • nope, i dont know about automator application – user325784 Apr 3 at 10:08
1

You can exit the terminal by calling to two commands after each other, execute script and then exit

$> myScript.sh && exit
  • With the default configuration for Terminal, adding && exit after a command does not close Terminal. – user3439894 Apr 4 at 12:26
  • @user3439894 What do you mean with "default configuration"? This works for me and I haven't changed anything special with my terminal except the look although I run OS X 10.14. I see you have tagged your question applescript, are you doing this from an applescript or directly in the terminal? – Joakim Danielson Apr 4 at 15:30
  • It doesn’t close Terminal for me either. It closes the window or tab that was running the shell process, but the Terminal app doesn’t exit until I physically do it myself. Therefore, @JoakimDanielson , I wonder if you have not noticed the app still running in the dock, or whether your indicator lights are off. – CJK Apr 17 at 20:41
  • @CJK I am pretty sure the Terminal app was not quit for me either and that was not my interpretation of the question since closing a window and exiting an app are two very different things. – Joakim Danielson Apr 18 at 5:39
  • @JoakimDanielson, yes I can see now how it has two possible interpretations, as "terminal" can refer to the interface with the shell, or the name of the macOS program that acts as a terminal. But, I think your interpretation is more correct here, as I see the OP was attentive to which of the two uses of "terminal" used a capitalised "T". A pity, as I've been searching for a way to quit Terminal upon closing the last open terminal. Moving along... – CJK Apr 18 at 10:03

You must log in to answer this question.

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