lilalo

diff l3bashrc @ 111:99ea38e538c9

Добавил:
* l3upload

Исправил:
* хинт теперь всплывает только при наведении непосредственно на команду
(а не на приглашение и не на символ кода завершения)
* подсветка неизвестных команд не такая сильная
author igor
date Sat Feb 16 13:41:48 2008 +0200 (2008-02-16)
parents 3cd466f35ad6
children da65f1cbaf3a
line diff
     1.1 --- a/l3bashrc	Wed Feb 13 02:41:57 2008 +0200
     1.2 +++ b/l3bashrc	Sat Feb 16 13:41:48 2008 +0200
     1.3 @@ -188,10 +188,8 @@
     1.4          echo -n Choose window to be shoot ... >&2
     1.5          [ -d ${_l3_home} ] || mkdir -p ${_l3_home}
     1.6          xwd -out "$_l3_home/$shot_name" \
     1.7 -        && echo  Ok\
     1.8 -        && echo Shot was successful. \
     1.9          && echo Screenshot is written to ${_l3_home}/${shot_name} \
    1.10 -        && echo Screenshot will appears in the lablog.
    1.11 +        && curl -s -F photo=@$_l3_home/$shot_name http://xgu.ru/l3-upload
    1.12      else
    1.13          {
    1.14              echo
    1.15 @@ -205,10 +203,35 @@
    1.16      fi
    1.17  }
    1.18  
    1.19 +l3upload()
    1.20 +{
    1.21 +    if [ $# -lt 1 ]
    1.22 +    then
    1.23 +        echo Usage:
    1.24 +        echo 
    1.25 +        echo    l3upload "<filename>"
    1.26 +        echo
    1.27 +        echo "<filename>" - name of the file to upload
    1.28 +        return 1
    1.29 +    else
    1.30 +        source=$1 
    1.31 +        target="${L3_SESSION_ID}_`date +%s`"_"$(echo $source|sed s@.*/@@)"
    1.32 +        if echo $source | grep -q http://
    1.33 +        then
    1.34 +            curl -s "$source" > /tmp/$target 
    1.35 +        else 
    1.36 +            [ -r "$source" ] || { echo "l3upload: Can't open $source for reading" > /dev/stderr; return 1; }
    1.37 +            cp $source /tmp/$target
    1.38 +        fi
    1.39 +        echo Uploaded file name is ${target}
    1.40 +        curl -s -F photo=@/tmp/$target http://xgu.ru/l3-upload && rm -f /tmp/$target
    1.41 +    fi
    1.42 +}
    1.43 +
    1.44  # Append lines from "$@" files to the end of the shell history
    1.45 -hist_append () 
    1.46 -{ 
    1.47 -    eval $(cat "$@" | sed 's/"/\\\\"/g' | while read line; do echo history -s \"$line\"\;; done); 
    1.48 +hist_append ()
    1.49 +{
    1.50 +    eval $(cat "$@" | sed 's/"/\\\\"/g' | while read line; do echo history -s \"$line\"\;; done);
    1.51  }
    1.52  
    1.53  l3_save_last_line ()