The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
ksh - test if string contains alphanumeric...
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
ksh - test if string contains alphanumeric...
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
10-16-2007
tugger
Registered User
Join Date: Oct 2007
Posts: 9
Think I've cracked it
I am using this code. The tests I have done appear to work.
while true
do
clear
echo "Enter Text: \c"
read t
case $t in
+([a-z]|[A-Z]|[0-9]|[' ']))
echo test string is okay
break
;;
*)
echo test string not okay
sleep 2
;;
esac
done
tugger
View Public Profile
Find all posts by tugger
Find tugger's past nominations received
Find tugger's present nominations given