Shell script to retrieve test files used for Programming for Performance Assignment 1
The script downloads files given as parameters. Files are placed inside a new directory (named data by default) in the current working directory.
- Download or copy+paste the contents of
getter.sh - Make sure the file has execution rights (
chmod u+x <possible_path>getter.sh) - Run like any other executable with the file numbers you want to download as parameters (e.g.
<possible_path>/getter.sh 0 1 2 3downloads files F0, F1, F2 and F3)
- accepts any number of integers as parameters
-cor--cleardeletes the current data folder of .vb and .dec files (leaves downloaded files)-aor--allfetches all of the files ⋅⋅* Downloading all of the files will take some time and some space, so use at your own risk
You can change a few things if you edit the script
LAST_FILEis the number of the last file on the server (245 at the time of writing, this could theoretically change)DATA_DIRis the name of the directory, where downloaded files are placed (databy default)CURL_OPTIONScan be used if you want to set run parameters for the curl commands (for example-sto run curl in silent mode)FILE_PREFIXis the prefix used for naming the downloaded files (Fby default)BASE_URLis pretty obvious, but might change at some point. Who knows?
You might want to set an alias for the command for more comfortable useage (mine is set to alias gt="<path_to_file/getter.sh">) for reusability.