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

Re: view the exit status from command line



Håkon Alstadheim <hakon@alstadheim.priv.no> writes:

> You don't need a command (at least with the versions of bash I've used
> the last 10 years), just make sure the variable does not get expanded
> before it is assigned to PS1. Like so: PS1='$?\$ '. now try executing
> /bin/true and /bin/false.

Indeed, thanks for enlightening me.  I've had this PROMPT_COMMAND for
a few years, never noticed that it is not necessary.

Cheers,
       Sven



Reply to: