Ian Phillipps wrote:
> This is shorter, and *much* more efficient:
>
> export PROMPT_COMMAND="perl
> -e'\$_=\$ENV{PWD};s!/.*(?=/.*/)!...!s;print'"
Saving two strokes:
s!/.*(?=/.*/)!...!s
s!.+(?=/.+/)!...!
To solve the original problem of putting the string
into the xterm title, this seems the shortest so far:
export PROMPT_COMMAND="pwd|perl -pe
'chop;s#.+(?=/.+/)#...#;\$_=qq(\e]0;\$_\a)'"
Andrew.
