home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / HAM_W32.ZIP / STARTUP.CSH < prev   
Encoding:
Text File  |  1994-05-12  |  5.4 KB  |  133 lines

  1. #  Startup.csh Release 2.2.j for Windows NT
  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 Program Manager 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.  (If you're satisfied you've already set the path
  13. #  variable to start with "." through regedit, you can delete this step.)
  14. if (path[0] != ".") set path = . $path
  15.  
  16. #  Useful constant.
  17. @     pi       = 3.1415926535897932384626433
  18.  
  19. #  Aliases to allow these functions to be used under cmd.exe albeit
  20. #  under different names.  (Date and vol conflict with cmd.exe builtins.)
  21. alias date     dt
  22. alias vol      vl
  23.  
  24. #  NT doesn't allow any directories to be placed ahead of the system defaults
  25. #  in a user's search path thru the Control Panel (where naturally, you'd want
  26. #  to set it), so to override the standard more and label and the NT SDK rm
  27. #  commands (without actually deleting them), we've given the Hamilton versions
  28. #  different names and used the alias facility instead.
  29. alias more     hmore
  30. alias label    hlabel
  31. alias rm       hrm
  32.  
  33. #  Aliases to simulate cmd.exe builtins.
  34. alias md       mkdir
  35. alias pause    (echo -n Press any key when ready ...; @ getchar; echo)
  36. alias rd       rmdir
  37. alias start    cmd /c start
  38. alias type     cat
  39.  
  40. #  Aliases and procedures for intercepting copy, xcopy and rename commands so
  41. #  that wildcarding won't be done before they're called.
  42. proc safecopy(files)
  43.    cmd /c copy $files; @ nowild = s; unlocal s
  44. end
  45. alias copy     (local s; @ s = ^$nowild; @ nowild = 1; safecopy)
  46. proc safexcopy(files)
  47.    xcopy.exe $files; @ nowild = s; unlocal s
  48. end
  49. alias xcopy    (local s; @ s = ^$nowild; @ nowild = 1; safexcopy)
  50. proc saferename(files)
  51.    cmd /c rename $files; @ nowild = s; unlocal s
  52. end
  53. alias rename   (local s; @ s = ^$nowild; @ nowild = 1; saferename)
  54. alias ren      rename
  55.  
  56. #  Intercept the dir command either with a simple alias (letting the C shell
  57. #  do the wildcarding first) or with the same kind of alias + proc mechanism
  58. #  used above to turn off wildcarding first.  (Dir behaves differently
  59. #  depending on whether you let it do its own wildcarding or not.)
  60.  
  61. #  Uncomment either the simple alias to let the C shell do the wildcarding:
  62. alias dir      cmd /c dir
  63.  
  64. #  or the following 4 lines to have dir work exactly like under cmd.exe:
  65. #  proc safedir(files)
  66. #     cmd /c dir $files; @ nowild = s; unlocal s
  67. #  end
  68. #  alias dir      (local s; @ s = ^$nowild; @ nowild = 1; safedir)
  69.  
  70. #  Intercept the del command so "del *.*" still gives the "Are you sure?"
  71. #  message.  (Alternately, you may prefer to simply alias it to rm.exe.)
  72. proc safedel(files)
  73.    cmd /c del $files; @ nowild = s; unlocal s
  74. end
  75. alias del      (local s; @ s = ^$nowild; @ nowild = 1; safedel)
  76. alias erase    del
  77.  
  78. #  Provide a help mechanism that can give either
  79. #     a) The Win32 error message corresponding to a specified error code or
  80. #        (if no code number is given) the status from the last command, or
  81. #     b) Help for a specified NT command.
  82.  
  83. proc help(errno)
  84.    if ($#errno == 0) @ errno = status
  85.    if (isnumber(errno[0])) then
  86.       winerror $errno   #  winerror is in the samples directory with source.
  87.    else
  88.       help.exe $errno
  89.    end
  90. end
  91.  
  92. #  Aliases to implement obsolete Unix C shell reserved words.  (You may
  93. #  not want these unless you have old habits.)
  94. alias breaksw  break
  95. alias endif    end
  96. alias endsw    end
  97.  
  98. #  Typical locally-defined aliases.  (Edit this section to define your own.)
  99.  
  100. alias di       diff -b!    #  "Diff interactive":  Merged diff using color to
  101.                            #     show changes.  Ignore white space differences.
  102. alias duc      du -c       #  Disk usage for the current disk only.
  103. alias beep     eval echo -n ^^a  #  Beep! (eval is used with an extra ^ so
  104.                                  #     just listing aliases won't beep at you.)
  105. alias mi       more -i     #  "More interactive":  Clear screen first for
  106.                            #     speed.  Don't exit if less than a screenful.
  107. alias f        fgrep       #  Faster name for fgrep.
  108. alias fn       fgrep -n    #  Fgrep and print line numbers.
  109. alias g        grep        #  Faster name for grep.
  110. alias h        history
  111. alias cdd      cd +c       #  Change directory AND disk.
  112. alias home     cdd ~       #  Change to the home directory and disk.
  113. alias q        exit
  114. alias ll       ls -L       #  Long listing of the directory.
  115. alias ld       ls -a +D -. #  List only the subdirectories.
  116. alias app      (cat >>)    #  Append stdin to a file.
  117. alias loadhist source -n ~\history.csh
  118. alias dumphist (history -s >~\history.csh)
  119. alias w        ((wait;beep))  #  Wait for background processes and beep.
  120.  
  121. #  If you like, count the nesting level of this invocation of csh.exe
  122. #  and put it into the prompt of nested invocations.
  123. if (! $?did_setlayer) then
  124.    if ($?layer) then
  125.       @        layer++
  126.       set      prompt1 = '[$layer] $@ $CDISK% '
  127.       set      prompt2 = '[$layer] $@ $CDISK? '
  128.    else
  129.       setenv   layer = 1
  130.    end
  131.    @  did_setlayer = 1
  132. end
  133.