NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Aw: Re: bin/48667 (awk: man page for gsub shows wrong order of arguments)



The following reply was made to PR bin/48667; it has been noted by GNATS.

From: "Kai-Uwe Eckhardt" <kuehro%gmx.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Aw: Re: bin/48667 (awk: man page for gsub shows wrong order of
 arguments)
Date: Fri, 21 Mar 2014 19:37:43 +0100

 >      sub(r, t, [s])
 >              substitutes t for the first occurrence of the regular expression
 >              r in the string s.  If s is not given, $0 is used.
 > 
 > % echo hi | awk '{ sub(".", "x", $0); print $0; }'
 > xi
 > 
 > Seems to me like it's doing what the man page says. Can you clarify?
 
 Yes, you are right. I was using the definition in gensub instead of sub.
 Sorry for the confusion.
 
 Kai-Uwe
 


Home | Main Index | Thread Index | Old Index