this is my first post so I would first like to say hi to everyone before asking my question...
I am in the beginning of learning bash scripting and haven't really gotten the hang of reading and writing files.
What I am trying to create is a bash script that by crontab is run every hour, it then checks a text file for links, wget's them all and then marks them as done.
Let's say I have this textfile /home/user/urls :
Then my bash script is in /home/user/bash/wget.sh :
exec < /home/user/urls
while read line
That is all I have done so it just prints the line, and I could of course just make it wget $line but I thought I want some more working before I do that.
Now what I was thinking is that it opens the file, loops through every line and on the lines not starting with # it does wget (the line).
After it has downloaded the url it adds a # before that line and continues the loop.
This would make it so if I wanted a file downloaded I would just put the url in this file and the script would within an hour (or any other crontab time) download the file and add a # first on the line so I know it's done.
Any help would be great