EMail Address Validation (Shell Script)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting EMail Address Validation (Shell Script)
# 1  
Old 05-20-2009
EMail Address Validation (Shell Script)

Hi,

Can anyone provide me the code snippet for EMail Address Validation.

User is going to enter the email address in form window. I need to validate the format is correct.

Thanks in Advance

BS
# 2  
Old 05-20-2009

Code:
case $1 in
 *@?*.?*) echo valid ;;
  *) echo not valid; false ;;
esac

# 3  
Old 05-20-2009
I really appreciate your immediate reply. Code snippet what you have provided is returning "valid" for wrong email id. Example ab,cd@test.com

Could you please help me to resolve this issue.

Regards
BS
# 4  
Old 05-20-2009
Here's one discussion thread on the email address subject.
This is NOT a complete solution as one would have to implement the RFC 821, RFC 822, RFC 733.
Use Google to find other sources.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with validation of URLs in shell script

hello every one I wrote the script to validate all the urls from my server . sourcing text file which contains the list of urls and trying to check every url and based on response printing url is up or not. the issue when i use the below code with url is printing url exist and and in loop it's... (3 Replies)
Discussion started by: markjohn1
3 Replies

2. UNIX for Dummies Questions & Answers

Validation to be added in the shell script

I need help with one of my shell script. The script is working fine but i need to add two condition - i need to get rid of all the below ftp messages and need to have only ftp completed or failed message. example when i run the script i get below lines - Connected to xxxx 220 (vsFTPd... (1 Reply)
Discussion started by: chandraprakash
1 Replies

3. Shell Programming and Scripting

String validation in shell script

Hi All, I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement: assume my file has content: hello= gsdgsd sfdsg sgdsg sgdgdg world= gggg hhhh iiiii xxxx= pppp ppppp pppp my... (1 Reply)
Discussion started by: rtagarra
1 Replies

4. Shell Programming and Scripting

Shell script validation using process.

Hi All, I have a shell script in Linux and it will be invoked by 2 methods, 1) An automated background process . 2) Logining into the box and directly executing the script. I need to put a validation in my shell script such that it will be executed successfully on when an... (11 Replies)
Discussion started by: vininx
11 Replies

5. Shell Programming and Scripting

how to write script to change email address

we have 4000 html pages that need an email address changed. eg) company@yahoo.com to company@hotmail.com we only want the file modified date to be changed when there has been a change to the file. Should I be using grep? I fairly new to UNIX and was told to using something like... (2 Replies)
Discussion started by: mchelle_99
2 Replies

6. Shell Programming and Scripting

Validation in shell script.

PICKUPDIR=/home/ready/ DROPDIR=/home/downloaded/ TODAY=$(date '+%d%m%y') LOGFILE=xyz-$TODAY.log ########### #FUNCTIONS# ########### #function to perform file transfer to servercopy folder opalO () { cd $PICKUPDIR for fileName in `ls -1 TES_ONE*` do cp $fileName $DROPDIR done } >>... (4 Replies)
Discussion started by: ravigupta2u
4 Replies

7. Shell Programming and Scripting

Need help in file validation by shell script

Hi I am new to this forum.I need a help in the following: We receve pipe delimited file with transaction ID,tran_date,Quest_cd,Ans_cd,ans_value. Same transaction ID can be repeated with different quest_cd and ans_cd. Basically I need to check if a perticular pair of quest_cd and ans_cd... (1 Reply)
Discussion started by: srichakra
1 Replies

8. Shell Programming and Scripting

IP address validation function

Hi does anybody have a ksh/sh/bash function that i can embed into my script that i could use to validate an inputted IP address, I tried using one big long regular expression but it got very long and complicated ie #!/bin/ksh echo " Please enter your IP address" read IP ---some function... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

9. Shell Programming and Scripting

Email address verification script

Hi Group, Please forgive in case this is discussed. I need help regarding a simple script to verify if the give address exist in the Ldap directory. If the email exists the script should exit with a 0 status or else a non zero status. I am currently using the following script (and it is... (4 Replies)
Discussion started by: Ramdas
4 Replies
Login or Register to Ask a Question