Xref: utzoo comp.unix.questions:7839 comp.sys.tahoe:31
Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!philmds!leo
From: leo@philmds.UUCP (Leo de Wit)
Newsgroups: comp.unix.questions,comp.sys.tahoe
Subject: Re: Need utils: head,yes,& nroff (-man) for SysV2 (CCI 2.21or2.22)
Keywords: dwb, tail, Power 6, BSD
Message-ID: <536@philmds.UUCP>
Date: 28 Jun 88 20:25:25 GMT
References: <6007@hqda-ai.ARPA> <8171@brl-smoke.ARPA>
Reply-To: leo@philmds.UUCP (L.J.M. de Wit)
Organization: Philips I&E DTS Eindhoven
Lines: 34

In article <8171@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes:
>In article <6007@hqda-ai.ARPA> jay@hqda-ai.ARPA (Jay Hiser) writes:
>>head: the opposite of 'tail'.
>
>if [ $# -eq 0 ]
>then	n=10
>else	case $1 in
>	[0-9]*)	n=$1;	shift;;
>	*)	n=10;;
>	esac
>fi
>exec sed -e ${n}q $*

I like that. He (Jay) also writes:
>yes: pipe the output to some other program that expects 'y' or 'n'.

#!/bin/sh
# yes - be repetitively affirmative

case $# in
0) set y;;
esac

exec sed '
: again
p
b again' <