LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 04-08-2010, 10:23 AM   #16
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32

Finally I came up with this.

Code:
who am i|awk '{print $6}'|cut -d\( -f 2|echo `cut -d\) -f 1` is logged into your system|mail -s "Alert Mail" root@localhost
Thanks all for your Help!

Happy Posting
 
Old 04-08-2010, 11:08 AM   #17
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
[QUOTE=ashok.g;3928571]
Quote:
Originally Posted by MensaWater View Post
Code:
echo "$USER logged in to system." |mail -s "$USER Logged in to your system" root@localhost
Thanks alot!
I am getting all expect that $user. It's printing a space.
UNIX and Linux are case sensitive. $USER is not the same as $user.
 
  


Reply

Tags
login, mail, remote


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail: forwarding mail to remote mail account Cadmium Linux - Software 2 01-14-2010 02:05 PM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 07:37 AM
how to make remote login and remote installation via libssh vdx Programming 5 09-10-2007 11:23 PM
Remote login with SSH, but display on remote computer. brodin Linux - Software 3 09-09-2007 04:01 AM
remote login screen but need local login lastkey Ubuntu 0 12-13-2006 02:41 AM


All times are GMT -5. The time now is 02:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration