Being creative with quoting:

export PROMPT_COMMAND='perl -e
"\$_=qq(\e]0;$PWD\a);s#/.*(?=/.+/)#...#;print"'

Comparing strokes:
pwd|perl -pe's#.+(?=/.+/)#...#;s#^#\e]0;#;y#\n#\a#'
perl -e"\$_=qq(\e]0;$PWD\a);s#/.*(?=/.+/)#...#;print"
perl -MCwd -e'\$_=cwd;s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'
perl -e'\$_=\$ENV{PWD};s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'

Re performance, the one that uses the Cwd module
is by far the slowest; using the $PWD environment
variable is fastest.

Andrew.

Reply via email to