-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, You wrote:
Luckson Bwalya wrote:
I need to send mail to all users. How can I create a subscriber's list for all users so that all the users can receive same mail.
[snip]
As root, use the attached script and pipe the output to a file, e.g.: bash:~ # getusers.pl > userlist
[snip] I think this is a better approach ( YMMV :-) ( printf "allusers:" ; cat /etc/passwd | grep -v nobody | \ awk '{FS=":" ; if($3>100){printf("%s,",$1);}}' | sed 's/,$//' ; echo ) \
/etc/aliases ; newaliases
to insert all users *except* system users ( on RedHat and perhaps others, system users happen to get higer ID's than 100 !!) And then cat /etc/aliases | grep -v ^allusers: >/etc/aliases ; newaliases to remove the allusers alias. - -tosi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6y5z66mRH+PEpr2YRArPjAJ0bLZkonEdxopIcc/l4/9+dZg0nUgCgqbX2 Vsy8T6K+JP5fJPbS53f4858= =tdg1 -----END PGP SIGNATURE-----