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.
      • ... Robert G. Werner
        • ... Dmitry Kohmanyuk Дмитрий Кохманюк
  • ... Newton, Philip
  • ... Newton, Philip
    • ... Simon Cozens
  • ... Newton, Philip
  • ... Andrew . Savige
  • ... Newton, Philip
    • ... Bart Lateur
  • ... Andrew . Savige
  • ... Pense, Joachim
  • ... Andrew . Savige
  • ... Andrew . Savige
  • ... Andrew . Savige

Reply via email to