Hello all;
I have little knowledge of bash programming, and I was wondering if you could help me out.
I would like to create a bash script, as detailed below.
process.sh is the bash script itself
list.dl is a text file. In this text file, the first line is the directory from /var/www/downloads/ I would like it to be (so if the first line is "testing" the full directory would be /var/www/downloads/testing). Starting from the second line downward, there are direct URL download links.
This is what I want the script to do:
- Read the first line of the textfile list.dl and save it as a variable.
- Delete the first line so that every used line becomes a URL download link
- Add the variable to the directory path (/var/www/downloads/testing if the first line said "testing")
- Go to the directory path (/var/www/downloads/testing)
- Wget every link from the text file to there
- Output a text file with all links to the files on the server (/var/www/downloads/testing/test.zip is already <ip>/download/testing.zip on my server) so that I may download them.
I have absolutely no idea how to program this, any help would be appreciated.
Sincerely,
tehalexf