home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / elfshell / part01 / .elven / es / main next >
Encoding:
Text File  |  1993-08-29  |  1.2 KB  |  50 lines

  1. #----------------------------------------------------------------------#
  2. #    File:    ~/.elven/es/main
  3. #    Auth:    North-Keys   Thu Jul 22 04:39:44 CDT 1993
  4. #    Desc:    elven scripts primary file, es version
  5. #----------------------------------------------------------------------#
  6.  
  7. fn echon args { echo -n $args }
  8. fn message args { if %interactive-p { echon $args } }
  9.  
  10. message 'lvn/es/4 '
  11.  
  12. if { ~ $LOGNAME } \
  13. {
  14.     if { whatis logname >/dev/null >[2=1] } \
  15.         { LOGNAME = `{logname} } \
  16.         { echon 'Who are we?: ' ; LOGNAME = `{ head -1 } }
  17. }
  18. if { ~ $HOME } { HOME = ~$LOGNAME }
  19.  
  20. ELVEN_PREV = $ELVEN ; ELVEN = $HOME/.elven
  21.  
  22. fn self args \
  23. {
  24.     if { ~ $args(1) - } { ENVIRON = () ; args = $args(2 ...) }
  25.     if { ~ 0 $#args } { files = main } { files = ($args) } 
  26.     for (f = $files) \
  27.     {
  28.         if { test -r $ELVEN/$f } \
  29.             { $&dot $ELVEN/$f } \
  30.             { if { test -r $ELVEN/es/$f } { . $ELVEN/es/$f } false }
  31.     }
  32. }
  33.  
  34. if { { ! ~ $LOGNAME $ENVIRON } || { ! ~ $ELVEN_PREV $ELVEN } } { self environ }
  35.  
  36. ELVEN_PREV = ()
  37.  
  38. if { ~ $TERM '|'* } { GURU = `{ echo $TERM | cut -c2- } ; TERM = guru ; $GURU }
  39.  
  40. if %interactive-p \
  41. {
  42.     self    traps        # set signal traps
  43.     self    functions    # get functions    and aliases
  44.     self    interface    # set interface
  45.     self    session        # get per session settings
  46.     echo .
  47.     .
  48. }
  49.  
  50. #----------eof