Link to home
Start Free TrialLog in
Avatar of Jason Yu
Jason YuFlag for United States of America

asked on

how can I let this script recognize several input emails for whitelist.sh

Hi, all;

I have a whitelist.sh file which takes user's input in email format and add this email to a file called whitelist (location: /data/postfix/amavis/whitelist). The script runs well with one shorcoming: everytime it only takes one email address and restart teh Amavisd service.  If we type two emails separated by "," or ";". This line would be saved on one line which I dont' think the system would accept. Is there a way to accept multiply email at one time from user's input.

thank you.
whitelist.sh.txt
SOLUTION
Avatar of Steven Vona
Steven Vona
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jason Yu

ASKER

I will try it tomorrow in work, thanks in advance.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi, skullnobrains, the code works,  Thank you very much.

If I want to improve my scripting, which book is your recommendation.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you very much, you did a great job for my learning.
Avatar of skullnobrains
skullnobrains


If I want to improve my scripting, which book is your recommendation.

none specifically. the basics of scripting can be learnt by playing with the shell using the commands you already know and using your shell's manual for reference. "man sh" and lookup what you need should do. other than that google is also a good help. first focus on understanding the basic topics one after the other : special variables, command redirections and pipes, variable expansion, command substitutions, ... by the time you understand what the shell does and in what order, you'll know all the basic commands