🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #95

Re: Prompt interpretation for bash

#95
From: James Van Artsdalen
Date: Wed, 14 Jun 1989 04:36
28 lines
1455 bytes
> From: composer@bu-cs.BU.EDU
> Date:  Tue, 13 Jun 89 18:21:50 EDT

|   Date: 13 Jun 89 18:13:53 GMT
|   From: milano!bigtex!james@cs.utexas.edu  (James Van Artsdalen)

|   PS1='`$PROMPT_COMMAND`rest_of_prompt'

The single quotes are no accident...

> I'm not that familiar with ksh specifics, so I'm not sure what you're
> referring to.  But, I'm able to get the same thing to work as what I
> believe you want the above to do.

> 	PS1="`$PROMPT_COMMAND`rest_of_prompt"

This doesn't do the same thing.

> The double quotes will allow the $variable to be expanded.  Is this
> what you were referring to?

No.  This question is *when* does the string get evaluated.  In your
example it got evaluated immediately and never again.  In my example,
it did not get evaluated immediately, and with my patch, it will be
re-evaluated each time the the prompt is printed.
---
James R. Van Artsdalen          james@bigtex.cactus.org   "Live Free or Die"
Dell Computer Co    9505 Arboretum Blvd Austin TX 78759         512-338-8789
Technical Details
Message-ID: <8906140436.AA14724@bigtex.cactus.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bigtex.cactus.org!james

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bigtex.cactus.org!james
From: james@bigtex.cactus.org (James Van Artsdalen)
Newsgroups: gnu.bash.bug
Subject: Re: Prompt interpretation for bash
Message-ID: <8906140436.AA14724@bigtex.cactus.org>
Date: 14 Jun 89 04:36:19 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 28