d1ljeq
Last Updated: February 25, 2016
·
1.16K
· mlafeldt
2190d7a468f51fa3be5eabfc9397a28b

Set up Dash as default shell for scripts on OS X

  • Install Dash via brew: brew install dash
  • Edit /etc/paths so that /usr/local/bin is at the top of the list.
  • Symlink /usr/local/bin/sh to Dash: ln -sf dash /usr/local/bin/sh
  • Start your scripts with #!/usr/bin/env sh

The benefits:

  • It is portable: your scripts will be run by Dash on OS X and Debian-based systems like Ubuntu (of course, the scripts themselves have to conform to POSIX).
  • It doesn't break OS X and apps that require /bin/sh to be Bash.
  • Dash is rad.
Say Thanks
Respond
Filed Under

Awesome Job

D591c606 4ca0 11e7 9f4d aa94ae9f338f
Staff Frontend Engineer
·
Remote! or San Francisco, CA
·
Full Time