home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / batnmore.z!p / ALIAS.TXT < prev    next >
Text File  |  1992-11-15  |  5KB  |  154 lines

  1. :This batch file is Freeware, free to use and redistribute unmodified
  2. :Jouni Miettunen * jon@stekt.oulu.fi * Oulu * Finland * Europe * 1992
  3. :Timestamp 15-Nov-1992
  4.  
  5. :----- UNIX COMPATIBLE COMMANDS AND UTILITIES -----------------------
  6. :turn FIND into simple GREP, enough for most of my greppings...
  7. :grep=break on^for %a in (%2&) find %1 %a^break off
  8.  
  9. :CLEAR screen
  10. clear=*cls
  11.  
  12. :Print Working Directory, do not change it even by mistake
  13. pwd=*cd^%&>&>nul
  14.  
  15. :Change Directory, by default into $HOME or root of boot disk
  16. cd=iff %# != 0 then^cdd %1^elseiff "%home"=="" then^cdd %_boot:\>&>nul^else^cdd %home>&>nul^endiff
  17.  
  18. :simple Word (==Line) Count.
  19. :wc=break on^for %t in (%&) echo tiedostossa  %t  on  %@eval[%@lines[%t]+1]  riviä.^break off
  20.  
  21. :Disk Usage
  22. du=*dir/ku
  23.  
  24. :my favourite more replacement
  25. :more=c:\tools\more
  26.  
  27. :resume working with program you have escaped from
  28. fg=exit
  29.  
  30. :cal 2.4 Unix & DOS compatible calendar w/reminder
  31. cal=\etc\cal -d %&
  32.  
  33. :mv=move/qr
  34. :cp=copy/qrvh
  35. :touch=copy con
  36. :more=iff %#==0 then^list/s^else^list %&^endiff
  37.  
  38. :----- OTHER UTILITIES ----------------------------------------------
  39. :Gary Masters: DOS5: A to Z
  40. :check file fragmentation in current directory
  41. frag=break on^iff %#==0 then chkdsk *.*|find g|sort|more^else if %#==1 .and. exist %1 chkdsk %1|find g|sort|more^endiff^break off
  42.  
  43. :Gary Masters: DOS5: A to Z
  44. :find files from all over the current disk
  45. :loc*ate=break on^iff %#==1 then chkdsk/v|find %1|sort|more^endiff^break off
  46.  
  47. :locates files-by-extension only on the basis of 3 *first* chars of %1
  48. :had to leave "break on^ ... ^break off" away to enable use with pipes
  49. ff=*dir/fkmsa \*%1*.*;*.*%1*
  50.  
  51. : following by Ray Tackett inspired by Michael Krause
  52. : can't always find aliases or environment variables, don't know why...
  53. : XSET=%1 | sort > %ramd%\tmp^set f=%@select[%ramd%\tmp,0,0,%_rows,%_columns,%2]^del %ramd%\tmp >&nul^if "%f" ne "" eset %@substr[%f,0,%@index[%f,=]]^unset f >&nul
  54. : SSET=iff "%1" eq "" then ^ xset set Environment ^ else eset %& ^ endiff
  55. : ASET=iff "%1" eq "" then ^ xset alias Aliases ^ else eset /a %&^endiff
  56.  
  57. :my update of same, still sometimes shows me there're no aliases/env. variables
  58. xset=%1|sort|set f=%@select[con,0,0,%_rows,%_columns,%2]^if "%f" != "" eset %@substr[%f,0,%@index[%f,=]]^unset/q f
  59. sset=iff "%1"=="" then^xset set Environment^else^eset %&^endiff
  60. aset=iff "%1"=="" then^xset alias Aliases^else^eset/a %&^endiff
  61.  
  62. :MicroEmacs 3.11 c2 uses control-p, so I have to re-enable it for while
  63. me=echo 16p^*me %1^echo 0;82;0;82p
  64.  
  65. :default for Christopher J. Dunfors's FastGREP 1.72 (from SIMTEL-20 mirror)
  66. fgrep=*fgrep -fx
  67.  
  68. :cawf - closest thing to nroff I've seen in DOS - ms macro support etc.
  69. cawf=*cawf -fn
  70.  
  71. :disable case for find and place target in quotes (only one target..)
  72. find=*find/i "%1"
  73.  
  74. :file compare default - just in case I don't want to use diff
  75. :fc=*fc /l/n/w
  76.  
  77. :indent defaults - c code beautifier
  78. indent=*indent -npsl
  79.  
  80. :----- SHORT CUTS ---------------------------------------------------
  81. :wide listing of all files/dirs; nothing, if there's nothing
  82. l=dir/vpabw>&>nul
  83.  
  84. :ls -l
  85. ll=dir/at
  86.  
  87. :list drive A:
  88. la=l a:
  89.  
  90. :list drive B:
  91. lb=l b:
  92.  
  93. :check file descriptions
  94. dir=*dir/kmp
  95.  
  96. :some file movement
  97. ma=*move/hqr %& a:
  98. mb=*move/hqr %& b:
  99. :mc=*move/hqr %& c:
  100.  
  101. :create New Directory and if successful, change into it
  102. nd=md %1 && cdd %1
  103.  
  104. :wipe directory and everything in and under it
  105. wd=del/xqysz>&>nul
  106.  
  107. :change one directory upwards
  108. ..=*cd ..
  109.  
  110. :hide some files and dirs
  111. hide=attrib/qd +h %&
  112.  
  113. :add archive attribute for backup purposes
  114. 2new=chmod +a %&
  115.  
  116. :remove archive attribute for backup purposes
  117. 2old=chmod -a %&
  118.  
  119. :anything new here?
  120. new=ls -lF|find _A_
  121.  
  122. :list local commands
  123. ?=l c:\tools
  124.  
  125. :edit aliases and load them
  126. real=me c:\4dos\alias.txt^unalias *^alias /r c:\4dos\alias.txt
  127.  
  128.  
  129. :----- ALL THE REST -------------------------------------------------
  130. :this came with my c compiler, nice.. idea is good
  131. :mc=\mc\^masterc^cd -
  132.  
  133. :Change Directory to Sources main directory (it keeps moving around..)
  134. src=\src\
  135.  
  136. :machine crashes every 5 minuts when I write new code.. history>history
  137. :now I can reload compilation commands and test commands after rebooting
  138. rehi=history /r history
  139.  
  140. :Power C is ANSI C compiler with System V support
  141. :Note: cc (below) means "Syntax Check". It has nothing to do w/unixish cc,
  142. : even though neither of them creates any working programs...
  143. debug=pc/2/a/c/e/s/t/w/y %1 && pct %&
  144. cc=pc/s/w/o- %1
  145.  
  146. :make describe work the way it should work by default
  147. desc*ribe=iff %@attrib[%1,h]==1 then^set h=1^attrib/q -h %1^endiff^iff %@attrib[%1,s]==1 then^set s=1^attrib/q -s %1^endiff^*describe %1 %2&^if "%h"=="1" attrib/q +h %1^if "%s"=="1" attrib/q +s %1^unset/q s h
  148.  
  149. date=echo Tänään on %_dow %_date
  150. time=echo Kello on %_time
  151. calc=echo Vastaus on: %@eval[%&]
  152. 4backup=xcopy/m c:\relax\*.* a:\relax^xcopy/m c:\4dos\*.* a:\4dosback.up
  153. :----- END ----------------------------------------------------------
  154.