Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 04-15-2005, 01:14 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 16

Rep: Reputation: 0
Bash script - mailing list

I am trying to write a simple bash script which will function as a mailing list,
using the mail function and a seperate list of emails. For example:


This is a test newsletter

How do I use cat and mail commands to send a copy of the newsletter to all the emails in the email list. ?

cat newsletter | mail???
Old 04-15-2005, 01:36 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Something like this should work:
for address in `cat maillist`;do
cat newsletter | mail $address -s "Here is your newsletter"
Old 04-15-2005, 01:58 PM   #3
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
One way is
mail -s "Da Subject" < newsletter

You can use some sort of for loop to replace with a user in a list you have.
Old 05-05-2005, 01:03 AM   #4
LQ Newbie
Registered: May 2005
Location: canada
Distribution: SuSE 8.0
Posts: 9

Rep: Reputation: 1
a simple question about shell scripting

I m a shell scripting newbie, and i m trying to create a shell script that search for some files names 'script', those files are located in the subdirectory of a directory named "folder", and for each file founded, i have to show the directory (full path) where the file was founded and pipe the file to some program.
the script must be something like that:

for each file found in the subdirectory tree of "folder"
"show the full path where the file was found, without the file name, like /root/folder/images"
enter this directory already showed ($cd directory)
"pipe the file to a program"

Thanks for help!!


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
mailing list utility 62chevy Linux - Software 2 12-04-2006 08:57 PM
Mailing list subaruwrx Linux - Software 0 12-21-2004 10:38 AM
Slack mailing list.... r_jensen11 Slackware 4 02-06-2004 06:02 PM
Mailing list Manager... tarballed Linux - Software 0 08-29-2003 12:43 PM
know a c++ mailing list nakkaya Programming 1 07-02-2003 10:45 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:49 AM.

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