Custom AIX Prompt

In my .profile, my prompt is set like this:

set -o vi
PS1=`logname`@`hostname -s`:'$PWD>'

Is there a way to show what the history number would be of the command I'm typing in the prompt? For example, I frequently run commands then run 'history' to pull up the history number of a command I want to repeat. Then I do [ESC] -> [history #] -> [g] to get my previous command. If I could show the history numbers in my prompt, this could cut out having to run history over and over again.

Thanks

If you shell has it, it is '!' .

For example.

PS1='$PWD ! > '
1 Like

Thank you!