bug-bash
[Top][All Lists]
Advanced

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

Re: PROMPT_COMMAND and PS1 error


From: Florian Mayer
Subject: Re: PROMPT_COMMAND and PS1 error
Date: Mon, 26 Oct 2015 14:21:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Ah thanks! Sadly paragraph https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution doesn't mention this behaviour. Would it be possible to add a line describing this? I know that it's in the manual somewhere else, but maybe you could prevent some unnecessary questions on this mailing list by (maybe redundantly) including some important
informations at the right spots in the reference manual.

Best regards
==== file: first.sh ====
. second.sh

sl-get(){
     sl-set
     sl-notify-change
     echo $?
}

sl-set-prompt(){
     PS1=$(sl-get)" >>"
sl-get is executed in a subshell, and any effect on the state of the
shell is forgotten after expansion.

Andreas.





reply via email to

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