On 8 June 2012 16:38, Clark WANG <[email protected]> wrote: > On Fri, Jun 8, 2012 at 10:06 PM, Dan Shelton > <[email protected]> wrote: >> On 30 May 2012 01:31, David Korn <[email protected]> wrote: >>> cc: [email protected] [email protected] >>> [email protected] >>> Subject: Re: Re: Re: [ast-developers] RFE: Extend ksh93 printf %q to accept >>> modifiers >>> -------- >>> >>> I have added %(html)q and %(url)q to the next release. >> >> I think there was a misunderstanding for using %(...)q for egrep > > There's not a standard or specification for %(...)q so there's no > misunderstanding here. I personally like the way %(ere)q and > %(pattern)q work. :) > >> expressions and similar things. The goal was to QUOTE strings that >> they retain any all characters in the target format in their literal >> meaning and not to CONVERT them like the current implementation for >> %(ere)q does. >> As an example, %(ere)q should quote special characters like (, ), [, >> ], {, }, \ with a preceding backslash so they are retain their literal >> meaning: >> >> printf '%(ere)q' 'hello(world)' >> hello\(world\) >> >> %(csv)q, %(html)q and %(url)q work as expected but %(pattern)q and >> %(ere)q need to be changed to just quote the values and not convert >> them into something different. > > They're not converted to something different. They're converted to > another form which means the same.
Clark, %q means 'quoting', not conversion. So I agree with Dan that from the spirit of naming plain quoting actions belong into %()q while whole conversions into a completely different pattern syntax should fall into something like %()C. Lionel _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
