dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

it2dl (417B)


      1 #!/bin/bash
      2 if [ $# -lt 1 ]; then
      3   echo "Usage: $(basename $0) file ..."
      4   exit 1
      5 fi
      6 for fn in "$@"
      7 do
      8   if [ -r "$fn" ] ; then
      9     [ -d "$fn" ] && { echo "$fn is a directory"; continue; }
     10     printf '\033]1337;File=name='`echo -n "$fn" | base64`";"
     11     wc -c "$fn" | awk '{printf "size=%d",$1}'
     12     printf ":"
     13     base64 < "$fn"
     14     printf '\a'
     15   else
     16     echo File $fn does not exist or is not readable.
     17   fi
     18 done