(01-05-2021, 04:56 AM)s0kx Wrote: phillbush, did you ever find a proper solution to your problem?
case "$PWD/" in "$HOME"/*) dir="~${PWD#"$HOME"}" ;; *) dir="$PWD" ;; esac echo $dir