my_var defined. How do I call $(my_var)_extension ?
Hi.
Within a bash script, I have a variable, stn_name, representing the name of a seismic station. I have a large number of these stations. Associated with each of these station names is a set of coordinates, also defined stn_name_coords
Within a for loop I'm looping over the station names and doing such and such. The basic structure is as follows:
stn="stn_name1 stn_name2 stn_name3 ....... stn_nameN"
stn_name1_coords="lat1 lon1"
stn_name2_coords="lat2 lon2"
.........................................
................etc....................
........................................
for i in $stn
do ........
prog "$(i)_coords" .... *** How is this done? ***
done
When I'm looping over the station names I need to pass each station's coordinates to a program that will calculate a value that I need, but I don't know how to call the 'stn_name_coord' variable correctly.
Any help would be much appreciated.
Thanks.
|