home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Welt 2006 March
/
PCWELT_3_2006.ISO
/
base
/
05_common.mo
/
usr
/
share
/
elvis-2.2_0
/
scripts
/
wc.ex
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
2004-02-22
|
292 b
|
13 lines
"This script defines a :wc alias, which counts words
alias wc {
"Count chars, words, and lines in the current file, or a given range of lines
local c=0 w=0 l=0 nolocked
!%g/^/ {
let l=l+1
let c=c+strlen(line()) + 1
try s/\w\+/let w=w+1/xg
}
calc c "chars," w "words," l "lines"
}