Date: Fri, 09 Nov 2001 23:39:20 -0800 From: "Christopher R. Maden" <crism@maden.org> To: freebsd-questions@freebsd.org Subject: Re: Help with AWK Message-ID: <5.1.0.14.0.20011109232932.00ae48d0@mail.maden.org> In-Reply-To: <20011110094234.B1578@ns2.wananchi.com> References: <3BEC628A.5050005@verizon.net> <20011109194842.E27386@ns2.wananchi.com> <3BEC628A.5050005@verizon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 At 22:42 9-11-2001, Odhiambo Washington wrote: >* Simon Morton <simon.morton@verizon.net> [20011110 02:17]: writing on the >subject 'Re: Help with AWK' >| If I understand correctly, the following should do it: >| >| awk -F: '$4==40{printf "^%s@.*\\.wananchi.com$:%s$:%s/:\n",$1,$3,$2;}' > >Hello Simon, > >That is not it ;). That line gives the following: > >#^user@.*\.wananchi.com3552YZb2gtYJeEZ1Y/: > > >What I want (from master.passwd) are the following fields with the extras > >^$1@.*\.wananchi.com$:$3:$2: > >$1 = login id >$2 = encrypted passwd >$3 = numerical UID > >All with colon as the separator. > >I need to extract those details for two groups of users - staff (GID==20) >and wheel (GID==0), >all in one command, if possible. I think Simon was on the right track, no? He just had a few extra punctuation marks in there. awk -F: '$4==0||$4==20{printf "^%s@.*\\.wananchi.com$:%s:%s:\n",$1,$2,$3;}' master.passwd I think just further tweaks to the printf ought to get what you want. ~Chris - -- Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc. DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training <URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ > PGP Fingerprint: BBA6 4085 DED0 E176 D6D4 5DFC AC52 F825 AFEC 58DA -----BEGIN PGP SIGNATURE----- Version: PGP Personal Privacy 6.5.8 iQA/AwUBO+zZqKxS+CWv7FjaEQJRUQCgwQi1B0TofS376uy3JgeneNAmGYQAnjdq OoBASkELKjcFs4RKjxsvJw4L =XivO -----END PGP SIGNATURE----- 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?5.1.0.14.0.20011109232932.00ae48d0>