1753824 Members
9333 Online
108805 Solutions
New Discussion юеВ

Troubles with cshell

 
SOLVED
Go to solution
Alex Lavrov.
Honored Contributor

Re: Troubles with cshell

Thanx, the issue with starting letter is solved :)

Now I'm looking for regexp that beside cheking that word starts with a letter, will check that the other symbols are only letters or numbers.

All the stuff I try, just don't work in csh ... (tcsh).


thanx in advance.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Peter Nikitka
Honored Contributor
Solution

Re: Troubles with cshell

Hi,

to come to your request

Now I'm looking for regexp that beside cheking that word starts with a letter, will check that the other symbols are only letters or numbers.

Starting with my switch/case but exiting/breaking in
default:

you can continue in stripping all legal chars and looking at the rest (needs tcsh):

set ok=`echo $field_1 | tr -d '[:lower:][:upper:][0-9]'`
if ($%ok) then
echo $field_1 contains $%ok illegal chars
exit 1
endif

mfG Peter

The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Alex Lavrov.
Honored Contributor

Re: Troubles with cshell

Thanx all for the help! :)

Have a nice weekend.
I don't give a damn for a man that can only spell a word one way. (M. Twain)