Hacker News new | ask | show | jobs
by mieko 3566 days ago
This is what I do, and just so others know:

Realize that if your personal account's shell is pointed into the homebrew installation in /usr/local, and you implode homebrew or wipe /usr/local, you won't be able to start a terminal until your shell is changed or the binary exists. Solving this without Terminal.app being able to launch is a minor annoyance.

3 comments

Right, so have Terminal run this instead:

  #!/bin/sh
  
  for shell in \
    /opt/local/bin/bash \
    /bin/bash \
    /bin/sh
  do
    [ -x "$shell" ] && exec "$shell" -l
  done
  
  echo >&2 "ERROR: No valid shell found!"
  read -r -s -n 1 -t 10 dummy
  exit 1
If you are able to run a script with #!/bin/sh, and /bin/sh becomes un-executable during the execution of your script, you're definitely having a bad time. :D
That is a very good point, thank you
The proof of this is trivial, and left to the reader.