[WBEL-users] Shell Scripting Help
John Haxby
jch at thehaxbys.co.uk
Wed Jun 15 05:13:03 CDT 2005
Andrew Vong wrote:
> Here's what I'm trying to achieve but don't really know how to:-
>
> /rkhunter --cronjob | mail -s ServerName - rkhunter - DATE
> someuser at somebox.com
>
> /where ServerName is my server name, someuser at somebox is my e-mail
> address and DATE is where I'd like to insert current date in my format
> (date | cut -f 1,2,3,6 -d " ")
>
> So when the e-mail comes in, I'd see this in the Subject header -->
>
> "ServerName - rkhunter - Wed Jun 15 2005"
rkhunter --cronjob | mail -s "ServerName - rkhunter - $(date "+%a %b %d
%Y")" someuser at somebox.com
Make sure you use double quotes (like I have) and not single ones.
jch
More information about the Whitebox-users
mailing list