bug-bash
[Top][All Lists]
Advanced

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

Re: continuously evaluated prompts/environmental variables


From: Chris F.A. Johnson
Subject: Re: continuously evaluated prompts/environmental variables
Date: Tue, 26 Nov 2013 03:38:17 -0500 (EST)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

On Mon, 25 Nov 2013, Edward Peschko wrote:

All,

I was wondering if there was a way to make an environmental variable
be evaluated each time it was accessed. In other words, with:

export PS1="`whoami`@`hostname`"

This works for the first time that the prompt is evaluated, what I
would like to have is a prompt to be continuously evaluated, so that
if whoami or hostname changes, the prompt changes along with it.

Is there a way to have the prompt - or any other environmental
variable - change in this way, based off external command?

  Use single quotes:

PS1='`whoami`@`hostname`'

--
Chris F.A. Johnson, <http://cfajohnson.com>



reply via email to

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