From owner-freebsd-questions@FreeBSD.ORG Sat Apr 16 23:19:39 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D730916A4CE for ; Sat, 16 Apr 2005 23:19:39 +0000 (GMT) Received: from smtp.orbitel.bg (smtp.orbitel.bg [195.24.32.22]) by mx1.FreeBSD.org (Postfix) with SMTP id 3EE7343D2D for ; Sat, 16 Apr 2005 23:19:38 +0000 (GMT) (envelope-from avenger@vip.bg) Received: (qmail 13848 invoked from network); 16 Apr 2005 23:19:36 -0000 Received: from unknown (HELO localhost) (10.0.0.4) by smtp.orbitel.bg with SMTP; 16 Apr 2005 23:19:36 -0000 Received: from smtp.orbitel.bg ([10.0.0.3]) by localhost (sof-rv2.orbitel.bg [10.0.0.4]) (amavisd-new, port 10024) with ESMTP id 27488-49 for ; Sun, 17 Apr 2005 02:27:41 +0300 (EEST) Received: from localhost (smtp.orbitel.bg [195.24.32.22]) by smtp.orbitel.bg (Postfix) with ESMTP id 12E13A5C575 for ; Sun, 17 Apr 2005 02:19:36 +0300 (EEST) Received: from 212.36.15.69 ( [212.36.15.69]) as user avenger@vip.bg@localhost by mail.orbitel.bg with HTTP; Sun, 17 Apr 2005 02:19:35 +0300 Message-ID: <1113693575.42619d8800806@mail.orbitel.bg> Date: Sun, 17 Apr 2005 02:19:36 +0300 From: "P.B.S." To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 212.36.15.69 X-Virus-Scanned: by amavisd-new at orbitel.bg Subject: A question about my bash prompt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2005 23:19:40 -0000 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?