From owner-freebsd-questions Thu Jul 19 1: 6: 2 2001 Delivered-To: freebsd-questions@freebsd.org Received: from exchange.twowaytv.co.uk (exchange.twowaytv.co.uk [194.6.2.173]) by hub.freebsd.org (Postfix) with ESMTP id 6805237B401 for ; Thu, 19 Jul 2001 01:05:58 -0700 (PDT) (envelope-from ADyas@twowaytv.com) Received: by exchange.twowaytv.co.uk with Internet Mail Service (5.5.2653.19) id <36F0R64N>; Thu, 19 Jul 2001 09:02:23 +0100 Message-ID: <911D8F660DF6D411B61F00500462BA01CC7C06@exchange.twowaytv.co.uk> From: Alex Dyas To: BSD Freak , FreeBSD Questions Subject: RE: Shell scripting gurus I nedd your help Date: Thu, 19 Jul 2001 09:02:22 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG $ for address in `cat admins.txt`;do ls -al | mail -s "Ouput of ls command" $address;done alex.. > Here's one for the shell scripting gurus: > > I have a file (admins.txt) with list of the e-mail addresses of my > systems administrators (on per line) eg. > > john@ourcompnay.com > fred@ourcompany.com > betty@ourcompany.com > ... > ...etc > > > I need to be able to e-mail them all the same message from the command > line or a shell script (with only one command) > > For example I might need to email them the output of an "ls -al". I > could: > > ls -al | mail -s "Ouput of ls command" john@ourcompnay.com > ls -al | mail -s "Ouput of ls command" fred@ourcompnay.com > ls -al | mail -s "Ouput of ls command" betty@ourcompnay.com > ... > .etc.. > > how can I do this with only one command taking each persons e-mail > address from the file admins.txt > > > Thanks in advance... > > --------------------------------------------- > Receive faxes 24x7, no second line necessary. > http://www.mbox.com.au/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message