I have written the following script (it does not support index yet). The issue I am having is regarding using netcat to load the page. I can do this manually using the command line but when I try to have my script issue the exact same commands I can it does nothing without error. The only possible thing I can think is that my output is going somewhere else?
#!/bin/bash
PORT=80
while [ true ]
do
echo "Type the address you wish to visit then, followed by [ENTER]:"
read address
path=${address#*/}
domain=${address%%/*}
nc $domain $PORT
printf "GET /$path HTTP/1.1\n"
printf "Host: $domain\n"
printf "\n"
printf "\n"
done