The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mail format problem: ali560045 Shell Programming and Scripting 5 06-04-2008 05:52 AM
better format for sending mail dr46014 UNIX for Advanced & Expert Users 3 05-16-2008 12:55 PM
Check the format of Date AAA Shell Programming and Scripting 2 11-28-2007 01:06 AM
Check for the correct date format in UNIx rawatds Shell Programming and Scripting 1 07-13-2006 03:24 AM
mail format problems nhatch Shell Programming and Scripting 4 03-11-2004 01:41 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-22-2007
Registered User
 

Join Date: Aug 2007
Posts: 2
Check for proper e mail id format

Hi,
We run an application called meta which reads user information from database and updates in LDAP.For that we have some scripts to check the uniqueness of mail ids between the existing LDAP and Database.It works fine when people enter mail ids in proper format (xxx.yyy@abc.com) but if it entered in wrong format (x 99 yy abc@com) the uniqueness check fails. We extract the mail ids in a text file before adding. Can you suggest any script which will remove the wrong entry. We use solaris 9 as OS.
Thanks in advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-22-2007
Registered User
 

Join Date: Aug 2005
Location: Bangalore
Posts: 196
try this:

for emailid in $(cat filename) ; do
echo $emailid | awk -FS="@" '{
if ( $1 == "" || $2 == "" || $2 !~ /\./ )
print "Invalid Id"
else
print "Valid Email Id"

}
Reply With Quote
  #3 (permalink)  
Old 08-23-2007
Registered User
 

Join Date: Aug 2007
Posts: 2
Thanks for idea

Thanks for the idea.Can you just provide me one more idea? If i want to read 1st column of some EXEL format file having two columns how do I do that?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0