help with mailing contents to a list of people


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help with mailing contents to a list of people
# 1  
Old 03-29-2009
help with mailing contents to a list of people

I have to create a unix program that will mail the contents of a file to a list of users.The file to be mailed will be provided as an argument to the program on the command line. The list of users or mail recipients should be a ”variable” that is created inside the program

This program MUST be created with just two lines of code. (Hint: make the variable “list” on one line, and the mail on the next line.)

Does anyone have an idea on how to do this? I can't figure out the second line

Line1 list= "email1, email2, email3"
Line2 mail $list > something?
# 2  
Old 03-29-2009
You are 90% there. The message to be sent is the first parameter to the script "$1". To preserve the contents of $list it needs to be in double quotes on the mail line. The mail command reads from standard input (in this case it reads from a pipe).

list= "email1, email2, email3" # Line 1
echo "$1" | mail "$list" # Line 2
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

How to create mailing list in openldap?

Hi. I want to create mailing list in my directory, however standart object classes groupOfUniqueNames and groupOfNames don't contain mail attribute. What is the common way to create mailing list in openldap? (0 Replies)
Discussion started by: urello
0 Replies

2. Shell Programming and Scripting

Create a list of directory contents

Well I did a search and didn't anything for my specific case. I got a directory with a bunch of text file. All of them have the following pattern on the filename "ABCD_<As of Date>.txt" Example: ABCD_20110301.txt ABCD_20110302.txt ABCD_20110303.txt All I want to accomplish is a Korn... (3 Replies)
Discussion started by: Shark Tek
3 Replies

3. Windows & DOS: Issues & Discussions

List Contents of Drive by size

I am having difficulty listing the contents of a specific disk drive including hidden files and folders by size on disk. Its been a while since i have used dos and batch files in windows as am used to UNIX so was wondering if anybody could help me with this? Regards, Alan Jackson (1 Reply)
Discussion started by: pure_jax
1 Replies

4. Shell Programming and Scripting

list files and contents

I have a group of getOSinfo.out files that I would like to list the filename and then its contents out to. I can do it for each one individually, but would prefer to do it all in one shot and have one large file that has all of the oslevels and filenames. I am not very handy with scripts, so I... (2 Replies)
Discussion started by: snakernetb
2 Replies

5. UNIX for Dummies Questions & Answers

Best way to list a directory's contents?

Hey guys! I'm so glad I found this site, I've had so many questions and have been left alone for roughly a year scanning man pages but It's just not quite cutting it for some things. So, I often like to list directories when browsing around my local machine, a friend's machine, or my web... (6 Replies)
Discussion started by: bbilheimer
6 Replies

6. Shell Programming and Scripting

Help with procmail mailing list

I need to find out for sure whether or not Solaris 10x86 comes with procmail installed? I only need it for mail subscription "Only" WE have about 51 mailing lists subscriptions from listproc. I need help just doing mailing lists. How to best go about this? I downloaded version for Solaris... (0 Replies)
Discussion started by: parente
0 Replies

7. UNIX for Advanced & Expert Users

Help with procmail mailing list

I need to find out for sure whether or not Solaris 10x86 comes with procmail installed? I only need it for mail subscription "Only" WE have about 51 mailing lists subscriptions from listproc. I need help just doing mailing lists. How to best go about this? I downloaded version for Solaris... (0 Replies)
Discussion started by: parente
0 Replies

8. UNIX for Dummies Questions & Answers

list contents of directory

I want to list the contents of a directory, but I do not want to use the ls, is there another way?? (3 Replies)
Discussion started by: carl_vieyra
3 Replies

9. Forum Support Area for Unregistered Users & Account Problems

Is mailing list supported.

Sir. I am intrested in joining of this forum. I want to know that is "Mailing List" is supported to send a query or not. Please reply. Rgds Sanju kumar (1 Reply)
Discussion started by: Sanju Kumar
1 Replies

10. UNIX for Advanced & Expert Users

Mailing list software?!?!?

HI all, I'm searching for mailing list software to install on my Linux RedHat 7.3 with Web interface if possible. Any suggestions??? Thank you all Regards. solvman (3 Replies)
Discussion started by: solvman
3 Replies
Login or Register to Ask a Question