if ( "$TERM" != "dumb" ) then

  # Everything in file ~/.fortune will be interpreted as command
  # parameters for fortune. Default is cs (czech texts).
  # To disable fortune, create ~/.fortune with single word `none'.

  setenv FORTUNEDIR /usr/share/games/fortune
  setenv FORTUNE cs
  [ -r ~/.fortune ] && setenv FORTUNE "`cat ~/.fortune`"

  if ( "$FORTUNE" != "none"  && \
       -x /usr/bin/fortune && \
       -x /usr/bin/tty ) then
    tty | grep -q not > /dev/null
    if ($status == 1) then
      echo
      /usr/bin/fortune $FORTUNEDIR/$FORTUNE
      echo
    endif
  endif
  unsetenv FORTUNE FORTUNEDIR
endif
