Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Nov 2001 18:11:06 -0500
From:      Simon Morton <simon.morton@verizon.net>
To:        Odhiambo Washington <wash@wananchi.com>
Cc:        FBSD-Q <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Help with AWK
Message-ID:  <3BEC628A.5050005@verizon.net>
References:  <20011109194842.E27386@ns2.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
If I understand correctly, the following should do it:

awk -F: '$4==40{printf "^%s@.*\\.wananchi.com$:%s$:%s/:\n",$1,$3,$2;}'

HTH
Simon

Odhiambo Washington wrote:

> Hello list,
> 
> I am stuck with awk.
> 
> What I need to do is for awk to read the /etc/master.passwd file and give me a line like
> this one below for users whose GID=20 or GID=0
> 
> I am not able to get the "\" after the ".*" and the $ after wananchi.com and I am also not able to get this done for
> users in GID=0
> 
> ^user2@.*\.wananchi.com$:1234:$1$Tz.OjMPg$5j5pGgjfUHFNlJaSLsr5P/:
> 
> The command I use is:
> 
>         awk -F ":" '{if ($$4==20) {print "^"$$1"@.*.wananchi.com"":"$$3":"$$2":"}}' < /etc/master.passwd > some_file
> 
> -Wash
> 
> S y s t e m s   A d m i n i s t r a t o r
> --
>                                               ~\\_                 
>  Odhiambo Washington                            \\\\               
>  Wananchi Online Ltd.,                          `\\\\\             
>  1st Flr Loita Hse, Loita Street                 |\\\\\            
>  PO Box 10286,00100-NAIROBI,KE.                   \\\\\|__.--~~\   
>  Fax: 254 2 313985-9                           _--~            /   
>  Fax: 254 2 313922                           /~ //////  _-~~~~'    
>  E-mail: wash@wananchi.com                  ('-//////-//           
>  URL	: http://www.wananchi.com            //////(((-)           
>  GSM: 254 72 743 223 / 254 733 744 121     /////"                  
>                                         _///"                      
> 
> +++
> Don't be humble ... you're not that great.
> 		-- Golda Meir
> 



-- 
http://www.SimonMorton.com
smorton at acm dot org
\rm -rf /bin/laden


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?3BEC628A.5050005>