[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parameter operator P should probably strip \[ and \] characters
From: |
Chet Ramey |
Subject: |
Re: Parameter operator P should probably strip \[ and \] characters |
Date: |
Tue, 28 Mar 2017 10:30:49 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 3/27/17 7:49 AM, Torka Noda wrote:
>> In general, you want the \[ and \] sequences expanded in all
>> cases where the result will eventually be fed to readline,
>> and stripped when it is not. It's not feasible for bash to
>> figure that out for itself, so you have to tell it. Since
>> those escape sequences get stripped when bash isn't going to
>> be doing line editing, you can put `set +o emacs +o vi' (or
>> whichever one is relevant for you) before expanding a string
>> using the @P modifier and get the results you want.
>>
>
>
> @p would strip \[ and \] characters, @P would not strip them? :)
I'll keep that in mind for a future version.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/