I would like to display current path in sh prompt (not bash shell), which currently just shows "#", I tried with introducing this
env PS1="$(whoami)@$(hostname):$(pwd)"
and
set PS1="$(whoami)@$(hostname):$(pwd)"
in /etc/profile
.
But as obvious this does not refresh when the the directory is changed or user changes. Please suggest a way to make this dynamic.
$()
runs a separate program; it would be faster to use environment variables, such as$LOGNAME
,$HOSTNAME
and$PWD
instead.