Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2001 11:57:58 +1000
From:      Sue Blake <sue@welearn.com.au>
To:        "Don O'Neil" <don@whtech.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Help w/ Awk
Message-ID:  <20010516115758.L26110@welearn.com.au>
In-Reply-To: <MOBBIPGJKBNNPGLGMFHFIEIBHCAA.don@whtech.com>; from don@whtech.com on Tue, May 15, 2001 at 06:09:34PM -0700
References:  <MOBBIPGJKBNNPGLGMFHFIEIBHCAA.don@whtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 15, 2001 at 06:09:34PM -0700, Don O'Neil wrote:
> I'm trying to write a simple script to extract the user name, UID and GID of
> each user in the /etc/passwd file and I'm not quite sure what I'm doing
> wrong here.... here's a code snippet;

Why not just use this:

awk -F: '{print $1 " " $3 " " $4}' < /etc/passwd

Works for me every time.
You could use another delimiter in your output instead of " " spaces.

-- 

Regards,
        -*Sue*-
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010516115758.L26110>