[net.wanted] csh, awk help

tiberio@seismo.UUCP (Mike Tiberio) (07/31/84)

I need help, i want to make the following bourne shell script run under
csh. This is not my actual script but has the same problems, how do
you pass parameters to an awk program? thanks... seismo!tiberio

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

mcferrin@inuxc.UUCP (P McFerrin) (08/03/84)

Parameters can be passed to awk of USG 5.0 systems by:

	awk [options] variable=value

The variable on the command line will have the specified value within the
program.  If I recall, the variable will NOT be set during the execution
on the BEGIN block.