Please use
[code][/code] tags around your code, to preserve formatting and to improve readability.
Your string values are confusing to me. Please explain exactly what you are doing, and give us some examples of the input, the desired output, and the actual output you get, if any.
At first glance, assuming ksh's
[[ test and extended globs are the same as in bash, then you can't match substrings this way. "
=" only matches
whole strings, so you have to formulate the glob to account for that, or else use a "
=~" regex match.
Also, depending on your exact goals, it might be possible to simply replace the test with a parameter substitution.
Code:
$ sub="ESTATE OF |SUCCESSION DE "
$ input="GEORGE ESTATE OF T MAY"
$ echo "${input/@($sub)}"
GEORGE T MAY
$ input="GEORGE SUCCESSION DE T MAY"
$ echo "${input/@($sub)}"
GEORGE T MAY
Finally,
$(..) is highly recommended over `..`. (The link is for bash, but it's equally true for ksh.)