2010-11-26 From which host am I logged in

Sometimes you want to adjust your settings in bashrc, depending from which host you are logging in from. The who command reveals the host, and then we use cut (from GNU coreutils) to get the correct field.

  FROM=$(who | grep `whoami` | cut -f2 -d"(")
  case $FROM in
    chara*)
      # Enter your settings here
      set -o vi
      ;;
  esac

Useful for those shared accounts, who no IT department seems to admit using, but which are mightily useful sometimes!