Best practice to define bash script
Default domain listing to current directory
Check if headers exists before extracting the referrer
Instead of reading files from paths, use an external cat and read from stdin
A single script to run preparations, and a single script to extract data