]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Extend head to accept --lines=-N (--bytes=-N) and to print all
authorJim Meyering <jim@meyering.net>
Sat, 3 May 2003 15:10:13 +0000 (15:10 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 3 May 2003 15:10:13 +0000 (15:10 +0000)
commit57c1158f0256f7f2e2204acc44dbfa72c494dbbe
treefa2c56c7555805b006209f5ebf98af51a2917775
parent61d5480f0085b792f1f31c50dd5bb405452be8d0
Extend head to accept --lines=-N (--bytes=-N) and to print all
but the N lines (bytes) at the end of the file.

Include full-write.h, full-read.h, inttostr.h, quote.h.
Use quote() in diagnostics, rather than literal `' marks.
(copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
New functions.
(elide_tail_lines_pipe, elide_tail_lines_file): New functions.
(head_file): Reorganize so as to call head from only one place.
(main): Likewise, for head_file.
Handle new, undocumented option, --presume-input-pipe.
Handle negative line and byte counts.
src/head.c