Script for mailing /etc/passwd information

mark m.roth2006 at rcn.com
Mon Jun 1 15:04:24 UTC 2009


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.
> 
The least complicated:

awk 'BEGIN { FS = ":";}{print $1 " " $NF;}' /etc/passwd | mail -s "users and
shells" <whoever's email address>

	mark




More information about the redhat-list mailing list