Skip to main content
4 events
when toggle format what by license comment
Nov 16, 2021 at 19:56 comment added user3439894 Just to name a few, like the 200+ POSIX shell script text executable, ASCII text files in /usr/bin, only one of which has an .sh file extension, I do the same as Apple and not needlessly give my executable shell scripts an .sh extension and if doubled-click in Finder do the exact same as you've described adding .command. I think most would agree one does not want to have to close a non-active window from Terminal every time under the conditions expressed in the question when tying to simplify an automated process.
Nov 16, 2021 at 17:21 comment added aswine I'm still on Mojave here, but double-clicking a .sh file just opens it in TextEdit. Do later versions of macOS act differently?
Nov 12, 2021 at 4:09 comment added user3439894 This answer, as currently written, fails to execute properly on macOS Catalina and later. Take time to read the manual page for the open command as the -a option is supposed to be used when opening an application. While this method of opening applications works when properly coded, nonetheless, it leaves a useless Terminal window open that one then has to close. The other answers do not suffer from this shortcoming. IMO This method is not at all what the OP had in mind as he could have just double click his existing shell script and ended up with the same results.
Nov 10, 2021 at 18:36 history answered aswine CC BY-SA 4.0