On Thursday 21 September 2006 12:37 pm, Morgan Walker wrote:
> Thanks Michelle that worked perfect.  Is there an easy variable I could
> throw in there that you know off hand which would include the time
> (MM/DD/YYYY) as well?

$( date ) will add the current date and time.  You can read the man page 
for date to find out how to format it so that it only shows the date or 
only the time or both, etc.

$( ) will start a sub-shell that runs whatever commands you put between 
the $( and ).

So you could do:
msg="The user  ${LOGNAME}  has logged into $( hostname ) at $( date )."
echo $msg | sendmail -s "User login"  [EMAIL PROTECTED]

-- 
Freddie Cash, LPIC-2 CCNT CCLP      Network Support Technician
School District 73                  (250) 377-HELP [377-4357]
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to