shell - Regex in KornShell -


I'm trying to check if a variable is a number or not, but I can not find it.

How do you check regular expressions (rex) in Corniche (KS)?

I have tried:

  if [[$ month = ~ "[0-9] {2}"]] if [[$ month = _ [0] -9] {2} _]]  

I can not find any documents on that.

Any insights?

  in matter of $ [0-9] [0- 9]) "ok" Echo ;; *) "No";;  

should work.

If you need a full regexp search, you can use egrep in this way:

  if resonates $ month Do Egrep -q '^ [0- 9] {2} $' then 'echo' is okay "second" no "file  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -