Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Apr 2005 02:19:36 +0300
From:      "P.B.S." <avenger@vip.bg>
To:        freebsd-questions@freebsd.org
Subject:   A question about my bash prompt
Message-ID:  <1113693575.42619d8800806@mail.orbitel.bg>

next in thread | raw e-mail | index | archive | help


First, please pardon me for my bad English.


So, this is my prompt:

PS1='(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ '

I am not really versed in bash, but I surmise that "echo $?" should be the exit
code of the most recently executed command. In effect, it is always zero, even
when I'm sure the exit code is NOT 0.

What's the problem with it?

Maybe it is actually printing the exit code of "tput" which is always zero? If
that's the problem, maybe the value of "$?" should be saved first and then
echoed at the end?

Any suggestions?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1113693575.42619d8800806>