On the server I connnect to my home path is like this:
/home/junk1/junk2/user. I can use the sed command
pwd | sed -e 's|^/\([[:alnum:]]*\)/[[:alpha:]]*/[[:alpha:]]*|/\1|' to shorten the directory path to this:
On the tmux status bar I can set the current directory with
set -g status-right '#(pwd)'. However, because i want to shorten the paths, I tried the above expression by setting:
set -g status-right "#(pwd | sed -e 's|^/ ([[:alnum:]]*\)/[[:alpha:]]*/[[:alpha:]]*|/\1|')"
This doesn't work. The status bar gets updated with some portion of the text from the sed expression. How can I fix this?