wget and bash variables

  • Thread starter Thread starter Deleted member 13721
  • Start date Start date
D

Deleted member 13721

Guest
Hey

I seem to be having issues getting wget to use bash variables to complete a url that has a date stamp.

Code:
 wget http://weatheroffice.gc.ca/data/radar/temp_image/WKR/WKR_PRECIP_RAIN_$YEAR_$MONTH_$DAYMONTH_$HOUR_00.GIF

Yes I do have variables set in the bash shell that are connected to the date command and they do work when I test them individually. Ive tried everything but I cannot get those variables to output just the number that is stored in the variables(including using escape characters). I had one way but it put percent signs in the spaces and kludged the numbers:\ . Any help would be greatly appreciated.
 
DutchDaemon said:
Additional: your syntax may be confusing. Try specifically separating variables with {}:

Code:
${YEAR}_${MONTH}_${DAYMONTH}_${HOUR}

That fixed it, now the numbers are being inputted properly. Thanks DutchDaemon and Phoenix.:P. This can be marked solved now.
 
Back
Top