LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-06-2004, 09:19 AM   #1
Cruger
LQ Newbie
 
Registered: Mar 2004
Posts: 14

Rep: Reputation: 0
bash script to send mail


Hi I'm trying to send the same letter to several users in the same maibox..
Is there a way I can write a script that makes the letter to close istself (and I don't have to add message and press Cnrl-D) ?

script so far:

mail -s Welcome user@mailbox
 
Old 03-06-2004, 09:25 AM   #2
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 449

Rep: Reputation: 31
Assuming user.list contains the list of users and letter is the letter.

#!/bin/bash
cat user.list|while read user
do
cat letter|mail -s "subject" $user
done
exit
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shel script mail send ("/" in mail address) problem anaid Linux - Networking 3 08-23-2005 08:41 AM
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 05:19 PM
How do I send mail from inside a script? bruno buys Linux - Software 3 10-06-2004 08:57 PM
CGI Script runs to send mail, but mail is never sent robertwo Linux - Newbie 2 06-10-2004 10:57 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 01:20 AM


All times are GMT -5. The time now is 08:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration