Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2001 22:11:48 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Drew Tomlinson <drewt@writeme.com>
Cc:        BSD Freak <bsd-freak@mbox.com.au>, questions@freebsd.org
Subject:   RE: Shell scripting gurus I nedd your help
Message-ID:  <15190.20468.15468.303628@guru.mired.org>
In-Reply-To: <5CD46247635BD511B6B100A0CC3F0239259FFB@ldcmsx01.lc.ca.gov>
References:  <15190.12306.39284.169499@guru.mired.org> <5CD46247635BD511B6B100A0CC3F0239259FFB@ldcmsx01.lc.ca.gov>

next in thread | previous in thread | raw e-mail | index | archive | help
Drew Tomlinson <drewt@writeme.com> 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.

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15190.20468.15468.303628>