On 2/5/18 9:05 AM, Greg Wooledge wrote: > On Sat, Feb 03, 2018 at 02:57:33PM +0100, Egmont Koblinger wrote: >> So the use case is: Someone wants to _add_ something to >> PROMPT_COMMAND. How to do that? > > PROMPT_COMMAND+=$'\n''my new stuff' > > Or, test whether PROMPT_COMMAND is currently empty, and only > append the newline (or semicolon) if it's non-empty. But the newline > should work in either case.
This is one of the options Egmont proposed in the message you quoted. The downside is slight: "the slight drawback is that the output of a simple, unquoted «echo $PROMPT_COMMAND» is pretty confusing. And, of course, this is not a solution that suddenly occurs to everyone as trivially as appending to an array." -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/