I could use a bit of bash help -- not even sure if this is possible...
In the beginning of my script, I assign a couple of variables:
Code:
emails_eric="eric@jj.com, ericl@mrpibb.com, eric_l@work.com"
emails_mark="mark@mark.com, mark@work.com, mark@home.com"
emails_dave="dave@mrd.com, dave@school.edu, dave@none.com"
then I do something like
Code:
for user in eric mark dave
echo $user
... do stuff with name user ...
done
Now, in the section do stuff with name user I'd love to use the for user loop to grab the emails from above. I can't figure this out:
I've tried stuff like
Code:
user_email="emails_"$user
echo $`echo $user_email`
What I would like to do is grab the values from the top of my script
So I could do something like "email emails_user", and it will use the list from above depending on the person.
Thanks,
Eric