So I am doing this homework and I have this code but I cannot seem to get it to work. Everytime I run the code, the terminal freezes at one point and won't continue and I have terminate the process.
#!/bin/bash
Date1= `date '+%Y-%m-%d-%H-%M-%S'`.html
export PATH=$PATH:/home/jre1.8.0_171/bin/
wget -O $Date1 https://forecast-v3.weather.gov/point/40.78,-73.97?view=plain
java -jar tagsoup-1.2.1.jar --files $Date1
I think my problem has to do with my wget line but I don't know what to do as I need get the exact variable made from the date function. Any advice on what to do?
Edit:
#!/bin/bash
Date1=`date '+%Y-%m-%d-%H-%M-%S'`.html
export PATH=$PATH:/home/jre1.8.0_171/bin/
wget -O $Date1 'https://forecast-v3.weather.gov/point/40.78,-73.97?view=plain'
java -jar tagsoup-1.2.1.jar --files ./$Date1
I now don't have the freezing terminal problem but now it says FileNotFoundException even though the file is being saved and in my documents. Could the site being down cause that problem but I can't imagine why as the file is being saved.
My suggestion is wrap url in single quotes. Change:
First:
to
Second, You have space after
=here:remove it.
Third, link does not work.