BASH command return value

John Abreau jabr at blu.org
Fri Aug 4 12:01:38 EDT 2000


On Fri, 4 Aug 2000, Subba Rao wrote:

> In BASH, why does the "\u" and "whoami" make a big difference for the $?
> value in PS1 string? The BASH version is 2.04.

The \u is interpreted by bash within the local process. The `whoami` runs
the "whoami" command while printing the prompt, and this updates the value
of $?. The $? in PS1 gets evaluated before the "whois" gets executed. 

--
John Abreau / Executive Director, Boston Linux & Unix 
ICQ#28611923 / AIM abreauj

Email: (temporarily)  jabr at world.std.com

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list