![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script $0 argument | painulyarun | UNIX for Dummies Questions & Answers | 2 | 03-25-2008 04:32 PM |
| problem with spaces and argument parsing | fabulous2 | Shell Programming and Scripting | 8 | 12-19-2007 08:27 AM |
| printing last argument in shell script | arunkumar_mca | Shell Programming and Scripting | 5 | 10-03-2006 05:32 PM |
| argument parsing... | midhun_u | Shell Programming and Scripting | 1 | 07-25-2006 07:38 AM |
| command line argument parsing | rmjoe | UNIX for Dummies Questions & Answers | 1 | 07-28-2005 12:39 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format. rmjoe123@hotmail.com has '@' sign and followed by a '.' to be more specific : >abc.sh rmjoe123@hotmail.com abc.sh should parse this email address and look for '@' and then '.'. If email address is valid, abc.sh should continue doing what it is doing. Otherwise abort with error message. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
echo 'a@b.com' | grep -q '.*@.*\..*' echo $? 0 echo 'a@bcom' | grep -q '.*@.*\..*' echo $? 1 |
||||
| Google The UNIX and Linux Forums |