bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use PROMPT_COMMAND(S) without breaking other scripts


From: Chet Ramey
Subject: Re: How to use PROMPT_COMMAND(S) without breaking other scripts
Date: Mon, 24 Aug 2020 15:37:12 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 8/24/20 12:58 PM, Martijn Dekker wrote:
> Op 24-08-20 om 15:57 schreef Chet Ramey:
>> I sometimes think I should have stuck with converting PROMPT_COMMAND to
>> an array. Either way, there's going to be a transition, and maybe that
>> would have been the easiest.
> 
> Is it too late? I think that would actually be cleaner than adding a
> separate array, per Koichi's report.

We're not "adding" anything. Bash just looks for this variable and reacts
if it finds it. It's not a special variable, and bash doesn't create it if
it doesn't exist.

What I mean is looking for PROMPT_COMMAND as happens now, and reacting a
different way if it's an array variable. That would resolve the existing
assignment issues, but open up the separate issues you describe.

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://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]