i have about 20 different users submitting a web form that executes a unix script in the background that sets EXECUTIONUSER to their unix id. i would like to use $EXECUTIONUSER to set their email address as EMAILADDR. of course their unix id does not match their email name either. for example:
if [ "$EXECUTIONUSER" = "unixid1" ]; then
EMAILADDR="1user@domain.com"
fi
the above could be done for each user but that seems kind of elementary. any crafty suggestions? thanx in advance.
using *sh, you could use a 'for' loop, but it's gonna loop each item.
I suggest you create your own function, that would exit as it matches the right item.
it's a bit like a script: it takes arguments/parameters
it's a bit like a 'for' loop: you have to make it "re-call" itself with shifted args...
this is recursive function. (is it?)
thanks for the response! this was pretty easy to implement as i already had a file with email addresses in it for the drop down on the web form. so i simply used your suggestion to put the unix id in front of the email address. i then used a variation of your code to set the EMAIL variable. thank again.