
# UNISRC_ID: @(#)field.sh	27.1	84/09/17  
# Extract one field (column) from standard input or named files.


# Check arguments:

	if [ $# = 0 ]			# doesn't check for valid fieldnumber.
	then
	    echo "usage: $0 fieldnumber [filenames...]" >&2
	    exit 1
	fi


# Save field number:

	field="$1"
	shift


# Do the work:

	exec awk '{print $'"$field"'}' $*	# might read stdin.
