How do I get a Mac “.command” file to automatically quit after running a shell script?

前端 未结 7 2292
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 23:47

In my shell script, my last lines are:

...
echo \"$l\" done
done

exit

I have Terminal preference set to \"When the shell exits: Close the wind

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-07 00:34

    This worked perfectly for me.. it just closes that execution window leaving other terminal windows open

    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.

提交回复
热议问题