edit first line of long file

Don Lewis del at thrush.mlb.semi.harris.com
Thu Oct 25 06:08:00 AEST 1990


In article <27144 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>On many machines, head uses standard I/O, and stdio reads in a block
>and head prints out the first line.  Then head exits, leaving the file
>seek pointer pointing at the second block.  Cat then reads and prints
>blocks two through the end.

And then there is SunOS.  In 4.0.x, `(head -1; cat) <file' prints the
first line twice because the mmap that cat does on its input file doesn't
take the file offset into account.  In 4.1, they fixed this bug and we
now get the same broken behavior as most other machines.
-- 
Don "Truck" Lewis                      Harris Semiconductor
Internet:  del at mlb.semi.harris.com     PO Box 883   MS 62A-028
Phone:     (407) 729-5205              Melbourne, FL  32901



More information about the Comp.unix.questions mailing list