Re: Easy way to programatically change /etc/passwd

From: James Jackson (James.Jackson@MAIL.STATE.AR.US)
Date: Tue Mar 18 2003 - 10:58:39 EST


Try this:

cat /etc/passwd | awk -F : '{print $2}' | sed 's/!/*/g' > passwd_new

Regards,

James Jackson

-----Original Message-----
From: pSeries AIX Geek [mailto:aixgeek@YAHOO.COM]
Sent: Tuesday, March 18, 2003 9:43 AM
To: aix-l@Princeton.EDU
Subject: Re: Easy way to programatically change /etc/passwd

I don't want to change EVERY ! to a *, only certain
ones. I.e., suppose I've dumped 300 new entries to
/etc/passwd; I only want to change the ! for those 300
entries.

--- Bruce Whittaker <bwhittak@ENERGY.COM.AU> wrote:
> Will this fix your problem ?
>
> cat /etc/passwd | tr \! \* > new_passwd
>
> Just be aware that all exclamation marks will be
> altered so first make
> sure that no doubles exist.
>
> Bruce Whittaker,
> CASS Support,
> Extension 34193
> External (02) 9269 4193.

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:40 EDT