-F option for awk

Jim Rogers jimr at hp-lsd.COS.HP.COM
Wed Aug 15 04:48:06 AEST 1990


The answer is to set up the output field separator to be a colon also.

For instance:

	awk -F":" 'OFS = ":" { print $1, $2 }' /etc/passwd

will print out the first two fields of the password file with the output
fields separated by colons.

Jim Rogers
Hewlett Packard Company



More information about the Comp.unix.questions mailing list