How to custom display prompt in KornShell to show hostname and current directory?

前端 未结 7 1016
一个人的身影
一个人的身影 2021-02-04 09:59

I am using KornShell (ksh) on Solaris and currently my PS1 env var is:

PS1=\"${HOSTNAME}:\\${PWD} \\$ \"

And the prompt displays: hostname:/fu

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-04 10:32

    and...

    if you work between two shells for most of your effort [ksh and bourne sh] and desire a directory tracking display on your command line then PWD can be substituted easily in ksh and if you use /usr/xpg4/bin/sh for your sh SHELL, it will work there as well

提交回复
热议问题