AWSOME wget script help
Hi
recently I have become interested in shell scripting and out of neccessity I have make a shell script for downloading files from a txt file stored in a given directory. All the downloaded files would be stored in a specified directory for later viewing.
heres the code.
__________________________________________________ _________________________
#!/bin/bash
#
filedir=/home/$user/.batchget/
#
dldir=/home/$user/.batchget/downloads
#
$num=0
#
if [ $filedir = cd $filedir ]
#------------------------------------------------
then
echo "batchget dir found"
#--------------------------------------------------
else
echo "making directory /home/$user/.batchget"
mkdir $filedir
echo "making file batchlog in /home/$user/.batchget"
cat > batchlog
sudo mv /home/$user/batchlog /home/$user/.batchget/batchlog
#------------------------------------------------------------
done
#-------------------------------------------------------
echo "reading batch file"
wget -nc -r -i /home/$user/.batchget/batchlog.txt -p $dldir
echo "completed"
echo "files in /home/"$user"/.batchget/downloads
#
exit
___________________________________________________________________________
As you can see this is just a rough draft of the code and surely riddled with errors. I have never done a shell script before and would definitly appreciate feedback on any tips or errors I have made.
thank!
Linux; life without walls, gates and windows!
Bookmarks