I want to display the current working directory in my prompt differently if I am in a symlink
than not.
I have this far:
[[ `pwd -P` = `pwd` ]] && echo "\[1;31m\]$(pwd -P)" || echo "\[1;32m\]$(pwd)"
will return the desired output but it will not work as a replacement for \w
in the command prompt.
I tried wrapping it with backticks but that just results in pwd -Ppwd
in the PS1
.
I want to conditionally change the color and the value if it is a symlink
or not which is why I want the if/else type decision.