csh, awk help

rik at ucla-cs.UUCP rik at ucla-cs.UUCP
Thu Aug 9 02:23:55 AEST 1984


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 at UCLA-CS.ARPA
					  ...!{ihnp4,ucbvax}!ucla-cs!rik



More information about the Comp.unix mailing list