pax_global_header00006660000000000000000000000064116401656500014516gustar00rootroot0000000000000052 comment=0376158288ef6ec2755e61f954100d7698f0eb3d buthead-1.1/000077500000000000000000000000001164016565000127735ustar00rootroot00000000000000buthead-1.1/.gitignore000066400000000000000000000000111164016565000147530ustar00rootroot00000000000000/buthead buthead-1.1/Makefile000066400000000000000000000001061164016565000144300ustar00rootroot00000000000000all: buthead CFLAGS+=-Wall -g -O2 -include Makefile.randomuselesscrap buthead-1.1/Makefile.randomuselesscrap000066400000000000000000000007111164016565000201630ustar00rootroot00000000000000# -*- Makefile -*- progs=buthead clean: -rm -f $(progs) prefix=/usr/local exec_prefix=$(prefix) bindir=$(exec_prefix)/bin INSTALL = install INSTALL_PROGRAM = $(INSTALL) --mode a+rx,ug+w INSTALL_DIR = mkdir --parent install:: $(progs) $(INSTALL_DIR) $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(progs) $(DESTDIR)$(bindir) uninstall:: -cd $(DESTDIR)$(bindir) && rm -f $(progs) install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) --strip' install buthead-1.1/buthead.1000066400000000000000000000012131164016565000144660ustar00rootroot00000000000000.TH BUTHEAD "1" "April 1" "buthead (latzutils)" "User Commands" .SH NAME buthead \- copies all but the first few lines .SH SYNOPSIS .BI buthead \ count .br .BI bh \ count .SH EXAMPLES .B buthead 5 file\-without\-header .br seq 5 | .B buthead 3 .SH DESCRIPTION .B Buthead copies all but the first .I count lines of stdin to stdout. .SH DIAGNOSTICS Terminates gracefully if EOF encountered within first .I count lines. .SH AUTHOR Written by Barak A. Pearlmutter on April 1. .SH BUGS Functionality overlaps with .BI tail\ \-n\ + count or .BI awk\ '(NR> count )' or .BI sed\ 1, count d .SH SEE\ ALSO head(1), tail(1), sed(1) buthead-1.1/buthead.c000066400000000000000000000021201164016565000145460ustar00rootroot00000000000000// buthead: pass through all but first n lines of standard input // Copyright 2002, Barak A. Pearlmutter // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. #include #include #include int main(int argc, char **argv) { long lines_to_skip, i; int c; char *p; if (argc != 2) { fprintf(stderr, "Usage: %s count\n", argv[0]); exit(2); } lines_to_skip = strtol(argv[1], &p, 10); if (errno || lines_to_skip < 0 || argv[1][0] == '\0' || *p != '\0') { fprintf(stderr, "buthead error: invalid line count '%s'\n", argv[1]); exit(2); } for (i=0; i