home *** CD-ROM | disk | FTP | other *** search
- :This batch file is Freeware, free to use and redistribute unmodified
- :Jouni Miettunen * jon@stekt.oulu.fi * Oulu * Finland * Europe * 1992
- :Timestamp 15-Nov-1992
-
- :----- UNIX COMPATIBLE COMMANDS AND UTILITIES -----------------------
- :turn FIND into simple GREP, enough for most of my greppings...
- :grep=break on^for %a in (%2&) find %1 %a^break off
-
- :CLEAR screen
- clear=*cls
-
- :Print Working Directory, do not change it even by mistake
- pwd=*cd^%&>&>nul
-
- :Change Directory, by default into $HOME or root of boot disk
- cd=iff %# != 0 then^cdd %1^elseiff "%home"=="" then^cdd %_boot:\>&>nul^else^cdd %home>&>nul^endiff
-
- :simple Word (==Line) Count.
- :wc=break on^for %t in (%&) echo tiedostossa %t on %@eval[%@lines[%t]+1] riviä.^break off
-
- :Disk Usage
- du=*dir/ku
-
- :my favourite more replacement
- :more=c:\tools\more
-
- :resume working with program you have escaped from
- fg=exit
-
- :cal 2.4 Unix & DOS compatible calendar w/reminder
- cal=\etc\cal -d %&
-
- :mv=move/qr
- :cp=copy/qrvh
- :touch=copy con
- :more=iff %#==0 then^list/s^else^list %&^endiff
-
- :----- OTHER UTILITIES ----------------------------------------------
- :Gary Masters: DOS5: A to Z
- :check file fragmentation in current directory
- 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
-
- :Gary Masters: DOS5: A to Z
- :find files from all over the current disk
- :loc*ate=break on^iff %#==1 then chkdsk/v|find %1|sort|more^endiff^break off
-
- :locates files-by-extension only on the basis of 3 *first* chars of %1
- :had to leave "break on^ ... ^break off" away to enable use with pipes
- ff=*dir/fkmsa \*%1*.*;*.*%1*
-
- : following by Ray Tackett inspired by Michael Krause
- : can't always find aliases or environment variables, don't know why...
- : 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
- : SSET=iff "%1" eq "" then ^ xset set Environment ^ else eset %& ^ endiff
- : ASET=iff "%1" eq "" then ^ xset alias Aliases ^ else eset /a %&^endiff
-
- :my update of same, still sometimes shows me there're no aliases/env. variables
- xset=%1|sort|set f=%@select[con,0,0,%_rows,%_columns,%2]^if "%f" != "" eset %@substr[%f,0,%@index[%f,=]]^unset/q f
- sset=iff "%1"=="" then^xset set Environment^else^eset %&^endiff
- aset=iff "%1"=="" then^xset alias Aliases^else^eset/a %&^endiff
-
- :MicroEmacs 3.11 c2 uses control-p, so I have to re-enable it for while
- me=echo 16p^*me %1^echo 0;82;0;82p
-
- :default for Christopher J. Dunfors's FastGREP 1.72 (from SIMTEL-20 mirror)
- fgrep=*fgrep -fx
-
- :cawf - closest thing to nroff I've seen in DOS - ms macro support etc.
- cawf=*cawf -fn
-
- :disable case for find and place target in quotes (only one target..)
- find=*find/i "%1"
-
- :file compare default - just in case I don't want to use diff
- :fc=*fc /l/n/w
-
- :indent defaults - c code beautifier
- indent=*indent -npsl
-
- :----- SHORT CUTS ---------------------------------------------------
- :wide listing of all files/dirs; nothing, if there's nothing
- l=dir/vpabw>&>nul
-
- :ls -l
- ll=dir/at
-
- :list drive A:
- la=l a:
-
- :list drive B:
- lb=l b:
-
- :check file descriptions
- dir=*dir/kmp
-
- :some file movement
- ma=*move/hqr %& a:
- mb=*move/hqr %& b:
- :mc=*move/hqr %& c:
-
- :create New Directory and if successful, change into it
- nd=md %1 && cdd %1
-
- :wipe directory and everything in and under it
- wd=del/xqysz>&>nul
-
- :change one directory upwards
- ..=*cd ..
-
- :hide some files and dirs
- hide=attrib/qd +h %&
-
- :add archive attribute for backup purposes
- 2new=chmod +a %&
-
- :remove archive attribute for backup purposes
- 2old=chmod -a %&
-
- :anything new here?
- new=ls -lF|find _A_
-
- :list local commands
- ?=l c:\tools
-
- :edit aliases and load them
- real=me c:\4dos\alias.txt^unalias *^alias /r c:\4dos\alias.txt
-
-
- :----- ALL THE REST -------------------------------------------------
- :this came with my c compiler, nice.. idea is good
- :mc=\mc\^masterc^cd -
-
- :Change Directory to Sources main directory (it keeps moving around..)
- src=\src\
-
- :machine crashes every 5 minuts when I write new code.. history>history
- :now I can reload compilation commands and test commands after rebooting
- rehi=history /r history
-
- :Power C is ANSI C compiler with System V support
- :Note: cc (below) means "Syntax Check". It has nothing to do w/unixish cc,
- : even though neither of them creates any working programs...
- debug=pc/2/a/c/e/s/t/w/y %1 && pct %&
- cc=pc/s/w/o- %1
-
- :make describe work the way it should work by default
- 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
-
- date=echo Tänään on %_dow %_date
- time=echo Kello on %_time
- calc=echo Vastaus on: %@eval[%&]
- 4backup=xcopy/m c:\relax\*.* a:\relax^xcopy/m c:\4dos\*.* a:\4dosback.up
- :----- END ----------------------------------------------------------
-