From owner-freebsd-questions Wed Jul 18 20:11:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id EC3E737B403 for ; Wed, 18 Jul 2001 20:11:48 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 22338 invoked by uid 100); 19 Jul 2001 03:11:48 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15190.20468.15468.303628@guru.mired.org> Date: Wed, 18 Jul 2001 22:11:48 -0500 To: Drew Tomlinson Cc: BSD Freak , questions@freebsd.org Subject: RE: Shell scripting gurus I nedd your help In-Reply-To: <5CD46247635BD511B6B100A0CC3F0239259FFB@ldcmsx01.lc.ca.gov> References: <15190.12306.39284.169499@guru.mired.org> <5CD46247635BD511B6B100A0CC3F0239259FFB@ldcmsx01.lc.ca.gov> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ 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 Drew Tomlinson types: > > Well, you *could* do: > > > > ls -al | mail -s "Output of ls command" `cat admins.txt` > > > > but it would be wrong. > I just happen to be taking an intro UNIX class this week and learned about > this today. I'm just curious why this would be wrong. Is it inefficient? > Why is the alias better? Yes, it's inefficient. Not necessarily in compute resources - that will depend on the MTA - but in administration time. If you set up a script, you have one command that will generate a specific email to all the admins. If you need it for some other mail, you'll have to set the command up again. If you then move the file, you'll have to find all such occurrences and fix them - and chances are you'll miss one. If you set up the alias, you can use it for any mail that needs to go to that group. Other commands can use the same alias. If you move the file, fixing the alias fixes them all. You can also use the alias for communicating with the group for other things. You can even make it available to the users as a means for requesting help, though there are problems with that. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message