home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hcshdemo.zip / csh-os2.zip / STARTUP.CSH < prev   
Text File  |  1994-06-15  |  5KB  |  120 lines

  1. #  Startup.csh Release 2.2.v for OS/2
  2.  
  3. #  This is a sample startup.csh file.  Hamilton C shell looks for this
  4. #  file in your home directory every time you start a new copy whether
  5. #  from the Start Programs menu or from the command line.  You should edit
  6. #  this file to customize it to your needs, in particular to add any
  7. #  alias definitions you always want available each time you start
  8. #  the shell.  Blank lines are ignored; text following a "#" on a given
  9. #  line is considered a comment.
  10.  
  11. #  Paste the current directory onto the front of the search path if it's
  12. #  not already there.  (See comments about the PATH variable in login.csh.)
  13. if (path[0] != ".") set path = . $path
  14.  
  15. #  Useful constant.
  16. @     pi       = 3.1415926535897932384626433
  17.  
  18. #  Aliases to allow these functions to be used under cmd.exe albeit
  19. #  under different names.  (Date and vol conflict with cmd.exe builtins.)
  20. alias date     dt
  21. alias vol      vl
  22.  
  23. #  Aliases to simulate cmd.exe builtins.
  24. alias md       mkdir
  25. alias pause    (echo -n Press any key when ready ...; @ getchar; echo)
  26. alias rd       rmdir
  27. alias start    cmd /c start
  28. alias type     cat
  29.  
  30. #  Alias to run the Microsoft/IBM label command.  (It has a bug which
  31. #  prevents it from properly reading command-line arguments unless called
  32. #  by cmd.exe.)  You can leave this commented out if you use the label.exe
  33. #  utility supplied with Hamilton C shell instead.
  34. #  alias label    cmd /c label
  35.  
  36. #  Aliases and procedures for intercepting copy, xcopy and rename commands so
  37. #  that wildcarding won't be done before they're called.
  38. proc safecopy(files)
  39.    cmd /c copy $files; @ nowild = s; unlocal s
  40. end
  41. alias copy     (local s; @ s = ^$nowild; @ nowild = 1; safecopy)
  42. proc safexcopy(files)
  43.    xcopy.exe $files; @ nowild = s; unlocal s
  44. end
  45. alias xcopy    (local s; @ s = ^$nowild; @ nowild = 1; safexcopy)
  46. proc saferename(files)
  47.    cmd /c rename $files; @ nowild = s; unlocal s
  48. end
  49. alias rename   (local s; @ s = ^$nowild; @ nowild = 1; saferename)
  50. alias ren      rename
  51.  
  52. #  Intercept the del command so "del *.*" still gives the "Are you sure?"
  53. #  message.  (Alternately, you may prefer to simply alias it to rm.exe.)
  54. proc safedel(files)
  55.    cmd /c del $files; @ nowild = s; unlocal s
  56. end
  57. alias del      (local s; @ s = ^$nowild; @ nowild = 1; safedel)
  58. alias erase    del
  59.  
  60. #  Intercept the dir command either with a simple alias (letting the C shell
  61. #  do the wildcarding first) or with the same kind of alias + proc mechanism
  62. #  used above to turn off wildcarding first.  (Dir behaves differently
  63. #  depending on whether you let it do its own wildcarding or not.)
  64.  
  65. #  Uncomment either the simple alias to let the C shell do the wildcarding:
  66. alias dir      cmd /c dir
  67.  
  68. #  or the following 4 lines to have dir work exactly like under cmd.exe:
  69. #  proc safedir(files)
  70. #     cmd /c dir $files; @ nowild = s; unlocal s
  71. #  end
  72. #  alias dir      (local s; @ s = ^$nowild; @ nowild = 1; safedir)
  73.  
  74. #  Alias for accessing help with the same command used in cmd.exe.
  75. alias help     helpmsg
  76.  
  77. #  Aliases to implement obsolete Unix C shell reserved words.  (You may
  78. #  not want these unless you have old habits.)
  79. alias breaksw  break
  80. alias endif    end
  81. alias endsw    end
  82.  
  83. #  Typical locally-defined aliases.  (Edit this section to define your own.)
  84.  
  85. alias duc      du -c       #  Disk usage for the current disk only.
  86. alias beep     eval echo -n ^^a  #  Beep! (eval is used with an extra ^ so
  87.                                  #     just listing aliases won't beep at you.)
  88. alias mis      more -i     #  More interactive small.  (faster, limited memory)
  89. alias mih      moreh -i    #  More interactive huge.
  90. alias mi       moreh -i    #  Choose your default "more interactive" as
  91.                            #     either the small or the huge version.
  92. alias f        fgrep       #  Faster name for fgrep.
  93. alias fn       fgrep -n    #  Fgrep and print line numbers.
  94. alias g        grep        #  Faster name for grep.
  95. alias h        history
  96. alias cdd      cd +c       #  Change directory AND disk.
  97. alias home     cdd ~       #  Change to the home directory and disk.
  98. alias q        exit
  99. alias ll       ls -L       #  Long listing of the directory.
  100. alias ld       ls -a +D -. #  List only the subdirectories.
  101. alias app      (cat >>)    #  Append stdin to a file.
  102. alias loadhist source -n ~\history.csh
  103. alias dumphist (history -s >~\history.csh)
  104. alias w        ((wait;beep))  #  Wait for background processes and beep.
  105. alias rot13    tr 'n-za-mN-ZA-M' 'a-zA-Z'    #  Encoder/Decoder for off-
  106.                                              #  color jokes on Internet.
  107.  
  108. #  If you like, count the nesting level of this invocation of csh.exe
  109. #  and put it into the prompt of nested invocations.
  110. if (! $?did_setlayer) then
  111.    if ($?layer) then
  112.       @        layer++
  113.       set      prompt1 = '[$layer] $@ $CDISK% '
  114.       set      prompt2 = '[$layer] $@ $CDISK? '
  115.    else
  116.       setenv   layer = 1
  117.    end
  118.    @  did_setlayer = 1
  119. end
  120.