Technical article 110524

SCO OpenServer 5.0.5 ksh equality test succeeds when it should not.

OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

On SCO OpenServer 5.0.5, 5.0.6 systems, the following equality test succeeds when it should not:

#!/bin/ksh
if [ "x-" = "x" ]
then
echo "This if test should not have succeeded"
fi

This problem does not occur on SCO OpenServer 5.0.0, 5.0.2, or 5.0.4 systems.

Cause

The problem only occurs if a non-POSIX locale is set.  For instance,
if LANG=en_GB.ISO8859-1 or LANG=de_DE.ISO8859-1, the problem will
occur.  The problem will not occur if LANG=C_C.C.

Solution

Therefore, to work around this, set LANG to C_C.C for the duration of the shell script.

From the Xinuos technical article database, record 110524. Reproduced with permission. The original is at www.sco.com/ta/110524, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.