> 
> 
> 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)               [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to