Greetings, people of UNIX/Linux forums.
I am having a problem with a script, where I am trying to create a new variable. The value of this variable would be dependent on the value in a couple other previous variables (all variables are 2-digit integers). Here is my code:
#set the stations
set stn = `cat wind_obs_${date}.dat | cut -c 3-7`
set mth = `cat wind_obs_${date}.dat | cut -c 10-11`
set day = `cat wind_obs_${date}.dat | cut -c 13-14`
set hr = `cat wind_obs_${date}.dat | cut -c 18-19`
set lat = `cat wind_obs_${date}.dat | cut -c 34-38`
set lon = `cat wind_obs_${date}.dat | cut -c 25-30`
set nlines = `cat -b wind_obs_${date}.dat | tail -1 | cut -c 4-7`
# all variables above are being set fine
if (whichruc == 1) then
setenv RUCDATA /ldm_data/gempak/rtma/ruc_oper
set infile = ruc5_oper.2008${mth}${day}${hr}.gem #problem line
else
setenv RUCDATA /ldm_data/gempak/rtma/ruc
set infile = ruc5_back.2008${mth}${day}${hr}.gem #problem line
endif
When I run this, I get an error saying:
set: Variable name must begin with a letter.
My variable name does begin with a letter and I cannot find a way for this to work. What should I do to ensure the value of the variables go into the file name?
Thank you!