Link to home
Start Free TrialLog in
Avatar of lcor
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> ";
Avatar of Tintin
Tintin

Even easier in ksh.

export PS1='$PWD$ '

ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can put the followings in your .profile:

   HOSTNAME=$(hostname)
   PWD=$(pwd)
   PS1='${HOSTNAME}[${PWD}] !# '

yuhz.

No need to set PWD.