Re: (FWD) Re: cvs commit: src/etc/periodic/daily 200.backup-passwd

2000-01-27 Thread Sheldon Hearn



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):/'

Sorry about that.

Ciao,
Sheldon.


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



Re: (FWD) Re: cvs commit: src/etc/periodic/daily 200.backup-passwd

2000-01-27 Thread Rodney W. Grimes

 
 
 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



Re: (FWD) Re: cvs commit: src/etc/periodic/daily 200.backup-passwd

2000-01-27 Thread Sheldon Hearn



On Thu, 27 Jan 2000 04:11:38 PST, "Rodney W. Grimes" wrote:

  sed 's/^\([ +-][^+-][^:]*\):[^:]*:/\1:(password):/'
 
 IMNSO sed is the wrong tool here,

No arguments from me, since my awk skills are limited.  However, I'll
point out that sed is doing a decent job without turning into an
invocation mess.  The awk program you sent is much longer.  Oh, and it
produces absolutely no output whatsoever over here.  :-)

Ciao,
Sheldon.


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