tags:

views:

12

answers:

2

Similar to question 1171663, AIX appears to not have the $HOSTNAME option available. $hname and $hostname are also non-existent. Other than doing the following within .profile -

export HOSTNAME=`hostname`

Is there an official manner where AIX users should be capable of getting the proper results when using:

PS1="${HOSTNAME}:\${PWD##*/} \$ "
A: 

Haven't tried it, but for the hostname - can't you mix your first example with your second?

PS1="`hostname`:\${PWD##*/} \$ "

Not sure about PWD bit though?

monojohnny
There's probably no reason to re-execute `hostname` each time the prompt is issued.
Dennis Williamson
Exactly. I would rather just gather the hostname once instead of every single time. It's neglectable, but good practice to do so.
T.J.
A: 
Try
export HOSTNAME=`uname -n` 
Sachin Chourasiya

related questions