The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-15-2007
tugger tugger is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 9
Smile ksh - test if string contains alphanumeric...

Okay I will let users input spaces as well

I am having a mental block. I have done a couple of searches but havent found anything that I understand (the likes of :alpha: and awk).

Basically I want to give the user an option to enter some text which will go down as a field within a flat file ( which is delimeted by : ).

I want to limit this to 50 characters (I believe I can use typeset -z50 for this)

I also just want a-z,A-Z,(spaces) and numbers. Whats the best way to validate the input?