lilalo

changeset 112:da65f1cbaf3a

l3prompt added
author igor
date Sat Mar 08 22:36:44 2008 +0200 (2008-03-08)
parents 99ea38e538c9
children 8287cb3530de
files l3bashrc l3prompt
line diff
     1.1 --- a/l3bashrc	Sat Feb 16 13:41:48 2008 +0200
     1.2 +++ b/l3bashrc	Sat Mar 08 22:36:44 2008 +0200
     1.3 @@ -151,9 +151,12 @@
     1.4                  old_file=\"/tmp/l3-saved-\$\$.\$RANDOM.\$RANDOM\"
     1.5                  /bin/cp -- \"\$1\" \"\$old_file\" 2> /dev/null
     1.6                  $editor_file \"\$@\" || ERR=\$?
     1.7 -                [ -e \"\$old_file\" ] \
     1.8 -                 && diff -u \"\$old_file\" \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null \
     1.9 -                 || diff -u /dev/null \"\$1\"  > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null
    1.10 +                if [ -e \"\$old_file\" ]
    1.11 +                then
    1.12 +                diff -u \"\$old_file\" \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null
    1.13 +                else
    1.14 +                diff -u /dev/null \"\$1\"  > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null
    1.15 +                fi
    1.16                  /bin/rm \"\$old_file\" 2> /dev/null
    1.17                  return \$ERR
    1.18              fi
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/l3prompt	Sat Mar 08 22:36:44 2008 +0200
     2.3 @@ -0,0 +1,13 @@
     2.4 +#!/usr/bin/perl
     2.5 +
     2.6 +$string="abcdefghijklmnopqrstuvwxyz";
     2.7 +$insert="\e[1K\e[10D";
     2.8 +$max=5;
     2.9 +
    2.10 +while (length($string) > $max) {
    2.11 +    $res .= substr($string, 0, $max).$insert;
    2.12 +    $string = substr($string, $max);
    2.13 +}
    2.14 +$res .= $string.$insert;
    2.15 +print "$res\n";
    2.16 +