[EMAIL PROTECTED] wrote:
> How about:
>
> export PROMPT_COMMAND="pwd|perl -pe
> 'chop;s#^.*(/.+/.+)\$#...\1#;\$_=qq(\e]0;\$_\a)'"
^
(ouch)
You should be able to get rid of '^.*' since you're not capturing that bit
-- *every* string begins with beginning-of-string and
zero-or-more-characters, so adding them doesn't make a difference to what
gets matched.
Arrg... I hadn't counted in the "maximal munch" side-effect. Without ^.*,
/.+/.+ is not the last two components because / will match the first / in
the string, not the second-to-last as forced through backtracking.
Cheers,
Philip
--
Philip Newton <[EMAIL PROTECTED]>
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.