Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2000 04:11:38 -0800 (PST)
From:      "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>
To:        sheldonh@uunet.co.za (Sheldon Hearn)
Cc:        obrien@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: (FWD) Re: cvs commit: src/etc/periodic/daily 200.backup-passwd
Message-ID:  <200001271211.EAA76788@gndrsh.dnsmgr.net>
In-Reply-To: <58105.948968676@axl.noc.iafrica.com> from Sheldon Hearn at "Jan 27, 2000 12:24:36 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> On Thu, 27 Jan 2000 00:23:23 PST, "David O'Brien" wrote:
> 
> > I think what you really want is:
> > 
> > 		sed 's/^\([^:#@+-]*\):[^:]*:/\1:(password):/'
> 
> Eeek, I don't know why I sent you that.  It should have been:
> 
> 	sed 's/^\([ +-][^+-][^:]*\):[^:]*:/\1:(password):/'

IMNSO sed is the wrong tool here, awk can deal with the
password file much easier than sed and should handle just
about any input just so long as it doesn't add any :'s to the
lines that we are trying to mungle the password out of:

BEGIN {FS=":"; OFS=":"; ORS=""}

//      {if (NF==10) {
                print $1,"(password):"
                for (n = 3; n <=NF; n++) print $n,"";
        } else
                print $0;
        print "\n";

Defantily works on diff, diff -u and diff -c.

-- 
Rod Grimes - KD7CAX @ CN85sl - (RWG25)               rgrimes@gndrsh.dnsmgr.net


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




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