Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

case insensitive match in ksh88 (?) test 2

Status
Not open for further replies.

w5000

Technical User
Nov 24, 2010
223
PL

hello,
is there a working "case insensitive" (i:) in ksh88 test? or I can only use other commands for testing (eg. grep -i)?

in ksh93 I get it working:
Code:
# ksh93
# A=tRee;B=Tree;[[ "${A}" = @(${B}) ]] && echo yes || echo not
not
# A=tRee;B=tRee;[[ "${A}" = @(${B}) ]] && echo yes || echo not
yes
# A=tRee;B=Tree;[[ "${A}" = @(~(i:${B})) ]] && echo yes || echo not
[red]yes[/red]
#

in ksh88:
Code:
# A=tRee;B=Tree;[[ "${A}" = @(${B}) ]] && echo yes || echo not
not
# A=tRee;B=tRee;[[ "${A}" = @(${B}) ]] && echo yes || echo not
yes
# A=tRee;B=Tree;[[ "${A}" = @(~(i:${B})) ]] && echo yes || echo not
[red]not[/red]
 
What about this ?
Code:
typeset -u A=tRee B=Tree;[[ "${A}" = @(${B}) ]] && echo yes || echo not

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top