Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
与问题 1171663 类似,AIX 似乎没有可用的 $HOSTNAME 选项。$hname 和 $hostname 也不存在。除了在 .profile 中执行以下操作 -
export HOSTNAME=`hostname`
是否有官方方式让 AIX 用户在使用时能够获得正确的结果:
PS1="${HOSTNAME}:\${PWD##*/} \$ "
还没有尝试过,但是对于主机名 - 你不能把你的第一个例子和你的第二个例子混合起来吗?
PS1="`hostname`:\${PWD##*/} \$ "
虽然不确定 PWD 位吗?
尝试这个:
export HOSTNAME=`uname -n`