git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-PS1 bash prompt setting

From
Junio C Hamano <junkio@cox.net>
Date
Nov 19, 2006, 06:28 UTC
Message-ID
<7vhcww7xxd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<BAYC1-PASMTP0635A081EAC964E03599B4AEE80@CEZ.ICE>
Sean <seanlkml@sympatico.ca> writes:
Show 18 quoted lines
> On Fri, 17 Nov 2006 09:38:02 +0100
> Nicolas Vilz <niv@iaglans.de> wrote:
>
>> Just a note:
>> 
>> this doesn't work with bash 3.2. I think they altered the way of
>> trimming variables in this version.
>> 
>> on systems with bash 3.2 installed, i get
>> [master!linus-2.6/vm/vm]$ 
>> with the example above.
>> 
>> on systems with bash 3.1, it works properly.
>
> Sorry bout that, I knew it was a bit fragile.  Was rather
> comical reading Junio's recent message about all the things not
> to do if you want portable shell code and noticing my 6 line script
> did 90% of them ;o)

Maybe I should have been more explicit when I said "${paremeter##word} and friends". Might not have been obvious, but I only meant the following four: %, %%, # and ##.

${parameter/pattern/string} and ${parameter//pattern/string} are not even in POSIX.

Previous: SeanNext: Nicolas Vilz
Message 3 of 4 in “Re: git-PS1 bash prompt setting”
  1. Nicolas VilzNov 17, 2006
  2. SeanNov 17, 2006
  3. Junio C HamanoNov 19, 2006
  4. Nicolas VilzNov 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.