Need utils: head,yes,& nroff (-man) for SysV2 (CCI 2.21or2.22)

Leo de Wit leo at philmds.UUCP
Wed Jun 29 06:25:25 AEST 1988


In article <8171 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <6007 at hqda-ai.ARPA> jay at 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' <<EOT
$1
EOT

Now there is still nroff to take care of. Anybody feels an urge to
add his "one"-liner, using sed 8-) ?

      Leo.



More information about the Comp.unix.questions mailing list