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 [email protected] http://cnswww.cns.cwru.edu/~chet/