I'm having the hardest time trying to get dynamically evaluated command output in my
PS1 prompt with zsh on Ubuntu 17.10. Here are a few attempts I've made (I begin in directory
/abc, and the prompt is in bold):
$ export PS1="$(pwd) > " /abc > cd /def /abc > pwd /def /abc > export PS1="\$(pwd) > " $(pwd) > export PS1='$(pwd) > ' $(pwd) > export PS1='\$(pwd) > ' \$(pwd) > [ragequit]
The first result is the closest, but it looks like the
pwd command is being evaluated only once when I define the
PS1 variable. Clearly there's something that I don't understand. What can I do to get
$(<cmd>) reevaluated every time the command prompt is displayed?