- How to add/edit email aliases:
This is useful when you have to send a report to many emails and you don't want to stress out too much the command line.
For example, you need to send email to email@example.com, firstname.lastname@example.org and email@example.com.
/etc/mail/aliases in your favorite editor and add the following line:
reporting: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org
Save the file and execute the command
gzaix@root:/etc/mail # newaliases WARNING: Group writable directory /var/spool WARNING: Group writable directory /var/spool/mqueue /etc/mail/aliases: 8 aliases, longest 121 bytes, 374 bytes total
Now your command line will be much simpler:
/some/script.sh | mail -s "Reporting of the script.sh" [color=green]reporting[/color]
PS: this was done on AIX but it should work on all distributions.