home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
EFFO
/
forum16.lzh
/
SOFTWARE
/
AWK
/
EXAMPLES
/
head
< prev
next >
Wrap
Text File
|
1991-05-06
|
395b
|
22 lines
#
# head - display the n first lines of a file
#
# syntax: awk -f head <file> <number of display lines>
#
# status: seems OK
# bug: please tell me
#
BEGIN { for (i in ARGV) print i, ARGV[i]
}
{ nc = nc + length($0) + 1
print $0
nw = nw + NF
if (NR > (ARGV[i]-1)) exit
}
END { printf("\n\n%3d lines %3d words %4d characters\n\n",NR,nw,nc ) }