Created
January 8, 2014 20:39
-
-
Save coderofsalvation/8324193 to your computer and use it in GitHub Desktop.
checks if string is valid email (bash function)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checks if string is valid email | |
function isemail(){ | |
emailTest=$(echo "${1}" | grep '^[a-zA-Z0-9._%+-]*@[a-zA-Z0-9]*[\.[a-zA-Z0-9]*]*[a-zA-Z0-9]$') | |
if [[ "$emailTest" != "" ] ; then return 0; else return 1; fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment