From owner-freebsd-questions Wed Jul 18 16:13:58 2001 Delivered-To: freebsd-questions@freebsd.org Received: from oddjob.adhesivemedia.com (oddjob.adhesivemedia.com [207.202.159.77]) by hub.freebsd.org (Postfix) with ESMTP id E398037B405 for ; Wed, 18 Jul 2001 16:13:55 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Received: from localhost (philip@localhost) by oddjob.adhesivemedia.com (8.11.1/8.11.1) with ESMTP id f6INDov79567; Wed, 18 Jul 2001 16:13:50 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Date: Wed, 18 Jul 2001 16:13:50 -0700 (PDT) From: Philip Hallstrom To: BSD Freak Cc: FreeBSD Questions Subject: Re: Shell scripting gurus I nedd your help In-Reply-To: <3320f53329d6.3329d63320f5@mbox.com.au> Message-ID: <20010718161255.X78208-100000@oddjob.adhesivemedia.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Why don't you create an email alias that points to that file (man aliases for more info) and then just do: ls -al | mail -s "Output of ls command" sysadminalias@ourcompany.com ? On Thu, 19 Jul 2001, BSD Freak wrote: > 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