I'm very new to AIX as well as ksh, but I currently have some downtime at work and am trying to configure my prompt to be both colored and show my current location.
At the moment, I get the correct path only once on login, afterwards it continues to show my user directory. Colors work fine. logname and hostname are correct.
PS1="$(echo "\033[35m`logname`\033[34m@\033[35m`hostname` \033[36m`pwd`\033[1;35m\n\>\033[0m") "
Can't show a screenshot, but sample output would look like this in any directory:
userid@hostname /home/look/a/subfolder
>
I tried a bunch of different versions but I either couldn't get it to show anything or all special characters appeared as written in .profile.
Any ideas what I'm doing wrong?
Edit: Thanks to Stéphane, ESC+CTRL+V works, it's ksh88. AIX 7.1
`pwd`
are executed when you set the variablePS1
, not when the shell displays the prompt.${.sh.version}
is not supported.i
) which gives the version.