home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff342.lzh / SKsh / .skshinit < prev    next >
Text File  |  1990-04-15  |  3KB  |  127 lines

  1. #*************************************************************************
  2. #
  3. #  Set up variables and flags
  4. #
  5. #*************************************************************************
  6.  
  7. options  +lEeFscC
  8.  
  9. PS1         = '$_ANSI_P3[$PWD]: $_ANSI_P1'
  10. PS2         = '$_ANSI_P3> $_ANSI_P1'
  11. PNPC        = 21
  12. LOGOUT      = 'echo "\nBye!\n"'
  13. LLMIN       = 4
  14. MAXDIST     = 5
  15. ROOT        = ':'
  16.  
  17. _ANSI_BS    = "^[[1m"
  18. _ANSI_BE    = "^[[m"
  19. _ANSI_IS    = "^[[3m"
  20. _ANSI_IE    = "^[[m"
  21. _ANSI_US    = "^[[4m"
  22. _ANSI_UE    = "^[[m"
  23. _ANSI_P1    = "^[[0;31;40m"
  24. _ANSI_P2    = "^[[0;32;40m"
  25. _ANSI_P3    = "^[[0;33;40m"
  26. _ANSI_CLEAR = "^[[H^[[2J"
  27.  
  28. _DIR_S      = "$_ANSI_P3"
  29. _DIR_E      = "$_ANSI_P1"
  30.  
  31. #*************************************************************************
  32. #
  33. #  Set up sksh aliases
  34. #
  35. #*************************************************************************
  36.  
  37. alias    unalias   = 'unset -a'
  38. alias    unfunc    = 'unset -f'
  39. alias    aliases   = 'set -a'
  40. alias    functions = 'set -f'
  41. alias    variables = 'set -v'
  42. alias    builtins  = 'set -b'
  43. alias    help      = 'set -bfa'
  44. alias    logout    = 'exit 0'
  45. alias    pwd       = 'echo "$PWD"'
  46. alias    clear     = 'echo -n $_ANSI_CLEAR'
  47. alias    cls       = 'echo -n $_ANSI_CLEAR'
  48. alias    ctpri     = 'ChangeTaskPri'
  49. alias    '.'       = 'source'
  50. alias    quit      = 'LOGOUT=""; exit'
  51.  
  52. if [ "$SIZE" = 'normal' ]    # large version only...
  53. then
  54.    alias makedir   = 'mkdir'
  55.    alias delete    = 'rm'
  56.    alias remove    = 'rm'
  57.    alias '!'       = 'history -e'
  58.    alias '!!'      = 'history -e -1'
  59.    alias ll        = 'ls -lbF'
  60.    alias dir       = 'ls -bF'
  61. fi
  62.  
  63.  
  64. #*************************************************************************
  65. #
  66. #  Set up sksh functions
  67. #
  68. #*************************************************************************
  69.  
  70. function path {   # set or examine path
  71.  
  72.     local component;
  73.  
  74.     if [ $# -eq 0 ]
  75.     then
  76.         echo "$PATH";
  77.     elif [ "$1" = "-add" -o "$1" = "add" ]
  78.     then
  79.         shift
  80.         for component in $* do
  81.  
  82.             if [ $( expr index "$PATH," "$component," ) -eq 0 ]
  83.             then
  84.                 PATH = "$PATH,$component"
  85.             fi
  86.  
  87.         done
  88.     else
  89.         PATH = "$1"
  90.     fi
  91.  
  92.     export PATH
  93. }
  94.  
  95. function run {  # run a program, searching the SKsh $PATH
  96.     local prog loc
  97.  
  98.     prog = $1
  99.     shift
  100.  
  101.     loc = $(which -s $prog)
  102.  
  103.     if [ -z "$loc" ]
  104.     then
  105.        echo "$prog not found."
  106.     else 
  107.        c:run $loc $*
  108.     fi
  109. }
  110.  
  111. function stack {  # set or change stack size
  112.  
  113.     if [ $# -eq 0 ]
  114.     then
  115.        c:stack
  116.        return
  117.     fi
  118.  
  119.     if [ $1 -lt 4000 -o $1 -gt 128000 ]
  120.     then
  121.        echo "Invalid stack size.  Use 4000 to 128000"
  122.        return
  123.     fi
  124.  
  125.     c:stack $(expr $1 + 10000)
  126. }
  127.