hi everyone -
i have a bash script that does, in broad terms, the following:
given a file containing a list of email accounts, for every account, do [lots of things], then move on to the next account. pretty simple, and all that stuff works fine.
thing is, there's a very good change that any account listed in the file may actually be listed repeatedly, but each account should only be processed once per run. so the obvious solution seemed to be to use an array...but i can't get it to work.
it seems like the logic should be pretty simple - if $user is already in the array, then simply move on to the next address in the file; if not, then do all the processing that needs to happen, put $user into the array, and move on to the next address.
the format of the file containing the addresses is simply one address per line:
user1@domain.dom
user2@domain.com
user@domain2.dom
i don't know if this will affect performance, but the theoretical max. number of users is somewhere over 1000, but less than 5000. we're currently at about 25, for whatever difference that might make.
can someone smarter than me please give me a nudge in the right direction? alternatively, is there some better method for preventing multiple runs for the same user?
thanks!
p.s. in reading through my post, i realized it sounds a little sinister - it's not, i promise. the script in question actually creates a daily report of subscribed users' spam folders (actually a list of all spams arriving within the past 24 hours, along with links to view each message & whitelist the sender), which are then emailed to the user. since we'll eventually allow public subscription, i'd very much like to avoid having some goofball get 7 copies just because he subscribed 7 times.