lcor
asked on
Ksh - Prompt shows path
How do you set the prompt to show current directory in ksh? It's easy in cshell.
alias cd 'cd \!*; set prompt="['hostname']<$cwd> ";
alias cd 'cd \!*; set prompt="['hostname']<$cwd>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can put the followings in your .profile:
HOSTNAME=$(hostname)
PWD=$(pwd)
PS1='${HOSTNAME}[${PWD}] !# '
HOSTNAME=$(hostname)
PWD=$(pwd)
PS1='${HOSTNAME}[${PWD}] !# '
yuhz.
No need to set PWD.
No need to set PWD.
export PS1='$PWD$ '