
applescript (even if they're themselves marked as executable, which is not normally the case):
are opened for editing in TextEdit.app or, if installed, with Xcode.app. with no shebang line: opens in your default text editor (which is TextEdit by default). with a shebang line (e.g., #!/bin/bash): behavior is as if the suffix were. command: Finder displays a misleading error message that suggests the problem can be fixed via File > Get Info, which is not true - use the chmod +x method suggested above. Make it executable by running chmod +x in Terminal otherwise, you'll see the following symptoms:. If the script is unexpectedly not executable:. For edge cases, such as finding a symlinked script's true source directory, see this answer. or, if you must remain POSIX-compliant, cd - "$(dirname "$0")". cd - "$(dirname "$BASH_SOURCE")" right after the shebang line.
To make a shell script change to the folder in which it is located, place.Caveat: the working folder is invariably the current user's home folder, NOT the folder in which the script is located.> Profiles you can opt to automatically close the window when the script exits. by default, the window will remain open after the script terminates so you can inspect the output (though at that point the shell that ran the script has exited and you cannot interact with it any longer).a new Terminal window opens in which the script runs.
are executed by default - no setup required:.
As of OSX 10.10 (Yosemite) and since at least OS X 10.8 (Mountain Lion), the behavior is as follows when you open (double-click) executable scripts from Finder: