5

Configuring the primary prompt to contain the history number and exit code

view full story
linux-howto

http://www.linuxquestions.org – Hi, I'm just trying to configure the primary prompt to contain the last history number and exit code of the previously executed command, seperated by a ':'(with no spaces). I tried assigining variable to PS1, but I only got it to display the exit code of the previously executed command but having problem with the history number. On startup the prompt should look like: [username@station username] 40:0 $ After every command, the history number should increase by one. Any help would really be appreciated. Thank you (HowTos)