[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-developers
Subject:    Re: [ast-developers] RFE: Extend ksh93 printf %q to accept modifiers
From:       "I. Szczesniak" <iszczesniak () gmail ! com>
Date:       2012-04-30 10:38:52
Message-ID: CALnxO56Sx7RFFNsscdWqun362gBPzHbgwuR1_NYkgF+EivTY2g () mail ! gmail ! com
[Download RAW message or body]

On Thu, Apr 19, 2012 at 1:40 PM, Clark J. Wang <dearvoid@gmail.com> wrote:
> 2012/4/19 ольга крыжановская <olga.kryzhanovska@gmail.com>
>>
>> Here's one of Roland's old proposals:
>>
>> RFE: Extend ksh93's printf %q to accept a modifier which defines the
>> quoting mode. Supported modes should be:
>>
>> %(kshliteral)q same as existing %q
>> %(shliteral)q quote string with '\' (including spaces) that a POSIX
>> shell (and even the old bourne shell) can accept it
>> %(xml)q convert string into an xml literal (same as %H)
>> %(egrep)q convert string into a literal accepted plainly by egrep
>> (e.g. things like '[', ']', '(', ')' etc. are quoted)
>> %(grep)q convert string into a literal accepted plainly by grep (e.g.
>> things like '[', ']', etc. are quoted)
>> %(agrep)q, %(xgrep)q convert string into a literal accepted plainly by
>> grep -X/-A (e.g. things like '[', ']', '(', ')' etc. are quoted)
>> %(urlencode)q convert string into a literal accepted plainly as URL
>> (e.g. space gets encoded as '+', '!' as '%21', '*' as '%2A' etc.)
>> The modifers scheme will allow future extensions easily.
>
>
> I like the idea. `%#q' added in 93u+ for CSV format is not very intuitive to
> me and `%(csv)q' would look better. :)

+1

I like the idea, too. Has been there a consensus with David and Glenn
about implementing this yet?

Irek

_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic