Re: [PATCH] preserve $_ value across prompt expansions
From:
Chet Ramey
Subject:
Re: [PATCH] preserve $_ value across prompt expansions
Date:
Thu, 14 Dec 2023 12:51:14 -0500
User-agent:
Mozilla Thunderbird
On 12/12/23 3:55 PM, Grisha Levit wrote:
Since expanding a prompt string that contains a funsub will modify the
value of $_, would it make sense to restore the value of $_ after the
expansion is complete, as we do when executing PROMPT_COMMAND?
If we're worried about this as a side effect, why not preserve $_ around
calls to function_substitute()? Or are the prompt string expansions the
only reasonable use case?
--
``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/