Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ucla-cs.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!trwrba!cepu!ucla-cs!rik
From: rik@ucla-cs.UUCP
Newsgroups: net.unix
Subject: Re: csh, awk help
Message-ID: <719@ucla-cs.ARPA>
Date: Wed, 8-Aug-84 12:23:55 EDT
Article-I.D.: ucla-cs.719
Posted: Wed Aug  8 12:23:55 1984
Date-Received: Fri, 10-Aug-84 02:37:33 EDT
References: <2505@seismo.UUCP>
Organization: UCLA CS Dept.
Lines: 12

Here's what I've found one has to use in csh scripts (I presume it will
work with sh as well):

#!/bin/csh
awk 'BEGIN{id='"$2"';}{ \
	printf(\"%8d %s\n\", id++, \$0); \
	}' $1

The quotes around $2 are necessary because $2 might contain blanks...

Rik Verstraete.					        rik@UCLA-CS.ARPA
					  ...!{ihnp4,ucbvax}!ucla-cs!rik