# HG changeset patch # User igor # Date 1205008604 -7200 # Node ID da65f1cbaf3a5bfbf7cec9d63014417cb99b5740 # Parent 99ea38e538c9c91807de02ec034c1365bb450464 l3prompt added diff -r 99ea38e538c9 -r da65f1cbaf3a l3bashrc --- a/l3bashrc Sat Feb 16 13:41:48 2008 +0200 +++ b/l3bashrc Sat Mar 08 22:36:44 2008 +0200 @@ -151,9 +151,12 @@ old_file=\"/tmp/l3-saved-\$\$.\$RANDOM.\$RANDOM\" /bin/cp -- \"\$1\" \"\$old_file\" 2> /dev/null $editor_file \"\$@\" || ERR=\$? - [ -e \"\$old_file\" ] \ - && diff -u \"\$old_file\" \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null \ - || diff -u /dev/null \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null + if [ -e \"\$old_file\" ] + then + diff -u \"\$old_file\" \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null + else + diff -u /dev/null \"\$1\" > \"\$L3_HOME/\$DIFFNAME\" 2> /dev/null + fi /bin/rm \"\$old_file\" 2> /dev/null return \$ERR fi diff -r 99ea38e538c9 -r da65f1cbaf3a l3prompt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/l3prompt Sat Mar 08 22:36:44 2008 +0200 @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +$string="abcdefghijklmnopqrstuvwxyz"; +$insert="\e[1K\e[10D"; +$max=5; + +while (length($string) > $max) { + $res .= substr($string, 0, $max).$insert; + $string = substr($string, $max); +} +$res .= $string.$insert; +print "$res\n"; +