home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / elfshell / part01 / .elven / csh / cshrc < prev    next >
Encoding:
Text File  |  1993-08-29  |  1.8 KB  |  63 lines

  1. #----------------------------------------------------------------------#
  2. #       File:     ~/.cshrc
  3. #       Author:   Christoph. Alex. North-Keys
  4. #       Descrip:  Foundation of the elven shell used by the author.
  5. #----------------------------------------------------------------------#
  6. alias echon 'echo -n \!*'
  7. if (X`echo -n` == X-n) alias echon 'echo \!*"\c"'
  8. if ($?prompt) then
  9.     alias message 'echon \!*'
  10. else
  11.     alias message 'echo \!* > /dev/null'
  12. endif
  13.  
  14. message "lvn/csh/3 "    # Tue Jul  6 05:21:40 CDT 1993
  15.  
  16. # lines to recover a login name and home directory
  17. if !($?LOGNAME)    then
  18.     (logname) >& /dev/null
  19.     if ($status) then
  20.         echon 'Who are we?: '
  21.         setenv LOGNAME "`head -1`"
  22.     else
  23.         setenv LOGNAME "`logname`"
  24.     endif
  25. endif
  26. setenv HOME ~$LOGNAME ; set home = $HOME
  27. if !($?ENVIRON) setenv ENVIRON ''           # set in environ
  28.  
  29. set ELVEN_PREV = ""
  30. if ($?ELVEN) then
  31.     set ELVEN_PREV = "$ELVEN"
  32. endif
  33. setenv ELVEN "$HOME/.elven"
  34.  
  35. setenv SHELL "$shell"
  36. if (! $?SHLVL) setenv SHLVL -1
  37. if (! $?shlvl) then
  38.     set shlvl = $SHLVL
  39.     @ shlvl++
  40.     setenv SHLVL $shlvl        # Yields  [0-?)
  41. endif
  42.  
  43. #    this emulates the single bash function, self ...
  44. alias selfind 'if (-f $ELVEN/\!:1) echo $ELVEN/\!:1; if (-f $ELVEN/csh/\!:1) echo $ELVEN/csh/\!:1 '
  45. alias selfif    'set _s=`selfind \!:1`; if ("X" != "X$_s" && -f "$_s") source $_s; unset _s'
  46. alias self        'set _f = cshrc ; if ( "X-" == "X\!*") setenv ENVIRON ""; if ( "X" != "X\!*" && "X-" != "X\!*" ) set _f = "\!*" ; selfif $_f ; unset _f'
  47.  
  48. if (("$ENVIRON" != "$LOGNAME")||("$ELVEN_PREV" != "$ELVEN")) then
  49.     self environ
  50. endif
  51. unset ELVEN_PREV
  52.  
  53. if ($?prompt) then
  54.     self    aliases        # get aliases
  55.     self    interface    # set interface
  56.     self    session        # get interactive additions
  57.     echo '.'
  58. endif
  59. #----------End of file----------#
  60. # Local Variables: #
  61. # backup-by-copying-when-linked: t #
  62. # end: #
  63.