lilalo

diff l3bashrc @ 148:266dae9ce2a1

mass upload
author igor@book.xt.vpn
date Tue Dec 16 00:18:23 2008 +0200 (2008-12-16)
parents 244825e244de
children 40d843395547
line diff
     1.1 --- a/l3bashrc	Thu Jul 17 11:20:58 2008 +0300
     1.2 +++ b/l3bashrc	Tue Dec 16 00:18:23 2008 +0200
     1.3 @@ -211,13 +211,15 @@
     1.4      then
     1.5          echo Usage:
     1.6          echo 
     1.7 -        echo    l3upload "<filename>"
     1.8 +        echo    l3upload "<filename> [<time>]"
     1.9          echo
    1.10          echo "<filename>" - name of the file to upload
    1.11          return 1
    1.12      else
    1.13          source=$1 
    1.14 -        target="${L3_SESSION_ID}_`date +%s`"_"$(echo $source|sed s@.*/@@)"
    1.15 +        time=`date +%s`
    1.16 +        [ -n "$2" ] && time="$2"
    1.17 +        target="${L3_SESSION_ID}_$time"_"$(echo $source|sed s@.*/@@)"
    1.18          if echo $source | grep -q http://
    1.19          then
    1.20              curl -s "$source" > /tmp/$target 
    1.21 @@ -230,6 +232,14 @@
    1.22      fi
    1.23  }
    1.24  
    1.25 +l3mass_upload()
    1.26 +{
    1.27 +    for i in "$@"
    1.28 +    do
    1.29 +      l3upload $i `perl -e 'print (((stat("$i"))[9])."\n")'`
    1.30 +    done
    1.31 +}
    1.32 +
    1.33  # Append lines from "$@" files to the end of the shell history
    1.34  hist_append ()
    1.35  {