On Fri, 14 Jan 2011 17:53:04 +1030, Wayne Sierke <w...@au.dyndns.ws> wrote:
> I suspect it is a transcription error by Robert in his email.
> 
> From man awk:
> 
>        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.
> 
> 
> So the correct syntax is:
> 
>         sub("[a-z]", " &", nr)

Works in this version, thanks! Reduction of 7 lines of code.
sub(from, to, where); is the correct form.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to