[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bmake: how about :tr/CHARS/REPL/[1g]
On Thu, Mar 26, 2009 at 09:07:51AM +0100, Aleksey Cheusov wrote:
> > >> How about adding new variable substitution :tr/CHARS/REPLS/[1g]
> > >> similar to tr(1).
> > Does the g flag really make sense here? Or, rather, does its
> > absence?
> S/str/repl/ defaults to S/str/repl/1, not to S/str/repl/g.
> tr/// should probably follow this rule.
'g' does not make sense for tr, and S doesn't default to '1', either.
(For those following along at home, 'g' on substitutions means to
substitute all matches in each word, like the g flag in sed
substitutions. '1' means to modify only the first word in the variable
and skip the others entirely.)
I'm not entirely convinced that anything really uses the '1' flag, but
it's Always Been There (TM).
David A. Holland
Main Index |
Thread Index |