BASH regex help
Neil Watson
tlug-neil-8agRmHhQ+n2CxnSzwYWP7Q at public.gmane.org
Fri Apr 21 16:29:29 UTC 2006
On Fri, Apr 21, 2006 at 12:11:04PM -0400, Chris F.A. Johnson wrote:
> Do you mean a-b or a-z? No capital letters?
I mean a-z. Still not working.
# Check for a proper url
if [[ $DOMAIN = *[!a-z0-9.]* ]] ; then
echo "Invalid URL a-b, 0-9 and . allowed only."
exit 1
fi
# We must escape special characters
DOMAIN = ${DOMAIN//./\\.}
Check 1 works. The substitution returns and error (DOMAIN: command not
found).
--
Neil Watson | Gentoo Linux
System Administrator | Uptime 1 day
http://watson-wilson.ca | 2.6.11.4 AMD Athlon(tm) MP 2000+ x 2
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list