I am setting the following in my users .profile file to display the last 3 directories in PWD but it's still only showing the home directory. Not sure what is wrong with this. Can anyone help, please?
me='$(whoami)'
function PWD {
pwd | rev| awk -F / '{print $1,$2,$3}'|rev|sed 's/ /\//g'
}
export PS1="$(whoami)@$(hostname -s)$PWD$ "
It keeps showing the user's home directory.