[orca-list] sf.sh update



This throws a couple too many arguments error messages on two different lines in the script but if you can live with those errors the script still works. What it does if given a sourceforge.net download url on the command line is to try using wget to download the url for you and as it downloads you'll get downloading messages on the screen. When it's finished downloading, it examines the wget-log file and lets you know your download statistics and the filename you downloaded. I thought this was not going to be that difficult to write but I got surprised.
Cut here.

#!/usr/bin/env bash
# file: sf.sh - sourceforge.net download script
if [ $# -lt 1 ]; then
echo 'download what from sourceforge.net?'
exit 1
fi
export saved=''
wget -bc --max-redirect=10000 --trust-server-names $1
while [ $saved=='' ]; do
sleep 5s
export saved=`tail -3 wget-log|grep -i "saved"`
if [ $saved=='' ]; then
  echo 'downloading.'
else
  echo "finished-> $saved"
fi
done
rm wget-log

--



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]