🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #84

Prompt interpretation for bash

#84
From: composer
Date: Tue, 13 Jun 1989 22:21
31 lines
1637 bytes
|   Date: 13 Jun 89 18:13:53 GMT
|   From: milano!bigtex!james@cs.utexas.edu  (James Van Artsdalen)
|
|   Here's an attempt to get bash to interpret prompt strings like ksh
|   does.  I don't the code all that well yet, hence the use of alloca to
|   protect against memory leakage through longjmp().
|
|   If all of the magic \ characters available to PS1 were made accessible
|   shell variables (so shell scripts could use them too), you'd have a
|   completely general solution.  PROMPT_COMMAND is merely a special case
|   of this scheme, as in
|
|   PS1='`$PROMPT_COMMAND`rest_of_prompt'

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"

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

|  James R. Van Artsdalen          james@bigtex.cactus.org   "Live Free or Die"
|  Dell Computer Co    9505 Arboretum Blvd Austin TX 78759         512-338-8789

				-jeff

Jeff Kellem
INTERNET: composer@bu-cs.bu.edu  (or composer%bu-cs.bu.edu@bu-it.bu.edu)
UUCP: ...!harvard!bu-cs!composer
Technical Details
Message-ID: <8906132221.AA04526@bucse.bu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!BU-CS.BU.EDU!composer
References: <18027@bigtex.cactus.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!BU-CS.BU.EDU!composer
From: composer@BU-CS.BU.EDU
Newsgroups: gnu.bash.bug
Subject: Prompt interpretation for bash
Message-ID: <8906132221.AA04526@bucse.bu.edu>
Date: 13 Jun 89 22:21:50 GMT
References: <18027@bigtex.cactus.org>
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 31