Subject: Re: ksh, PS1 and $?
To: Frederick Bruckman <fredb@immanent.net>
From: Denis Lagno <dlagno@rambler.ru>
List: netbsd-users
Date: 04/28/2005 10:37:28
On Thu, Apr 28, 2005 at 12:44:23AM +0000, Frederick Bruckman scribed:
> This is all very silly, but how about this...?
> 
>   export PS1='$(_status=$?; echo [$(id -nu)@$(hostname -s) \($(tty | sed s/\\/dev\\///)\) $(date "+%H:%M:%S") $(pwd) $_status$; exit $_status) '
> 
> By grabbing the status early, and using "exit" to reassert it at the end
> of the pipeline, you avoid the "bug" (and no temporary file is needed).

O!  Looks like right combination:)
Thanks.