>cut down on the amount of time he spends sending out reports. He spends
>hours sending them, and it just seems to me a total waste of time.
>Besides, it's a great oppertunity to get Linux in the front door for a
>change!
What the following does is find users belonging to the given group, and send
the given mail to them. You can modify this according to your needs. Hope this
helps, Ferenc
(echo "Subject: dummysubject";echo;echo "Hi")|mail `./selectusers usergroup`
Where selectusers is:
#!/bin/sh
grpid=`grep "^${1}:" /etc/group | cut -d: -f3`
if [ -z "$grpid" ] ; then
echo "$0: gimme a group" 1>&2
exit 1
fi
( awk -F: '$3=='$grpid' { n=split($4,a,",");
for(i=1;i<=n;i++) printf "%s\n",a[i] }' /etc/group ;
awk -F: '$4=='$grpid' { printf "%s\n",$1 }' /etc/passwd ) | sort -u
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************