Created
September 13, 2015 17:59
-
-
Save zwily/78ee19953f50f4b1dc4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: download.sh file ..." | |
exit 1 | |
fi | |
for fn in "$@" | |
do | |
if [ -r "$fn" ] ; then | |
printf '\033]1337;File=name='`echo -n "$fn" | base64`";" | |
wc -c "$fn" | awk '{printf "size=%d",$1}' | |
printf ":" | |
base64 -w 0 < "$fn" | |
printf '\a' | |
else | |
echo File $fn does not exist or is not readable. | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment