Script for mailing /etc/passwd information

Chris St. Pierre stpierre at NebrWesleyan.edu
Mon Jun 1 13:16:49 UTC 2009


On Mon, 1 Jun 2009, Manuel Aróstegui wrote:

> On Mon, 2009-06-01 at 16:10 +0300, a bv wrote:
>> Hi list,
>>
>> I need a script which will get the users and their shell from
>> /etc/passwd file and mail it to the company mail account which i use
>> on Lotus Notes. Im not yet a scripting guy so i wanted to ask to you.
>>
>> Regards
>>
>
> Can't you email them just using "mail -s" and using the FROM account you
> just want?
>
> That would make things easier

Indeed.  No script is necessary:

mail -s "/etc/password on `hostname`" whoever at example.com < /etc/passwd

Chris St. Pierre
Unix Systems Administrator
Nebraska Wesleyan University


More information about the redhat-list mailing list