I would like to have your suggestions to find out whether some characters are present in the alphanumeric string.
For example, i have string like 9235793579usa9485 and i want to know how to use KSH pattern matching whether it has any alphabets ( either a-z or A-Z ) in it.
Thanks in advance!
$ LANG=C
$ s=9235793579usa9485
$ case $s in (*[A-z]*) echo ok;; esac
ok
$
If your shell supports POSIX character classes, you could use [:alpha:].
Consider the following:
$ s=9235793579�
$ case $s in (*[A-z]*) echo ok;; esac
$ zsh -c 's=9235793579�; case $s in (*[A-z]*) echo ok;; esac'
$ zsh -c 's=9235793579�; case $s in (*[[:alpha:]]*) echo ok;; esac'
ok