Way OT: getting values of list of variables
Hi,
I'm sorry about this being so OT, but I've been searching around in
documentation (man pages, books, scripting HOWTOs, etc) for a several hours
now, and I can't find anything that will answer my question.
I have a series of variables that I'm importing to a bash script from another
file, and I need a way to run a loop to echo the contents of each one in
sequence. As an example, say this file has the following:
var1=data1
var2=data2
var3=data3
var4=data4
Is there some way I can make my script start with var1 and echo each one
through var4 WITHOUT hardcoding each seperate variable into the script?
I hope my question isn't too foggy, but I'm mighty tired at the moment, and I
can't guarantee that my brain is functioning correctly. I GREATLY appreciate
any help that anyone can offer, whether it be an answer or a suggestion of a
place to look for more help.
Thanks,
Jeremy
Reply to: