home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff279.lzh / Ash / .ashinit next >
Text File  |  1989-11-20  |  2KB  |  97 lines

  1. #*************************************************************************
  2. #
  3. #  Set up variables and flags
  4. #
  5. #*************************************************************************
  6.  
  7. options  +lEeFs
  8.  
  9. PS1         = '$_ANSI_P3[$PWD]: $_ANSI_P1'
  10. PS2         = '$_ANSI_P3> $_ANSI_P1'
  11. PNPC        = 21
  12. LOGOUT      = 'echo "\nBye!\n"'
  13.  
  14. _ANSI_BS    = "^[[1m"
  15. _ANSI_BE    = "^[[m"
  16. _ANSI_P1    = "^[[0;31;40m"
  17. _ANSI_P2    = "^[[0;32;40m"
  18. _ANSI_P3    = "^[[0;33;40m"
  19. _ANSI_CLEAR = "^[[H^[[2J"
  20.  
  21.  
  22. #*************************************************************************
  23. #
  24. #  Set up ash aliases
  25. #
  26. #*************************************************************************
  27.  
  28. alias    unalias   = 'unset -a'
  29. alias    unfunc    = 'unset -f'
  30. alias    aliases   = 'set -a'
  31. alias    functions = 'set -f'
  32. alias    variables = 'set -v'
  33. alias    builtins  = 'set -b'
  34. alias    help      = 'set -bfa'
  35. alias    logout    = 'exit 0'
  36. alias    makedir   = 'mkdir'
  37. alias    delete    = 'rm'
  38. alias    remove    = 'rm'
  39. alias    pwd       = 'echo "$PWD"'
  40. alias    clear     = 'echo -n $_ANSI_CLEAR'
  41. alias    cls       = 'echo -n $_ANSI_CLEAR'
  42. alias    '!'       = 'history -e'
  43. alias    '!!'      = 'history -e -1'
  44. alias    ll        = 'ls -lb'
  45. alias    dir       = 'ls -b'
  46. alias    ctpri     = 'ChangeTaskPri'
  47. alias    .         = 'source'
  48.  
  49.  
  50. #*************************************************************************
  51. #
  52. #  Set up ash functions
  53. #
  54. #*************************************************************************
  55.  
  56. function path {   # set or examine path
  57.  
  58.     local component;
  59.  
  60.     if [ $# -eq 0 ]
  61.     then
  62.         echo "$PATH";
  63.     elif [ "$1" = "-add" -o "$1" = "add" ]
  64.     then
  65.         shift
  66.         for component in $* do
  67.  
  68.             if [ $( expr index "$PATH," "$component," ) -eq 0 ]
  69.             then
  70.                 PATH = "$PATH,$component"
  71.             fi
  72.  
  73.         done
  74.     else
  75.         PATH = "$1"
  76.     fi
  77.  
  78.     export PATH
  79. }
  80.  
  81. function stack {  # set or change stack size
  82.  
  83.     if [ $# -eq 0 ]
  84.     then
  85.        c:stack
  86.        return
  87.     fi
  88.  
  89.     if [ $1 -lt 4000 -o $1 -gt 128000 ]
  90.     then
  91.        echo "Invalid stack size.  Use 4000 to 128000"
  92.        return
  93.     fi
  94.  
  95.     c:stack $(expr $1 + 12000)
  96. }
  97.