Technical article 104912

While using the tr(C) command, I get the error "tr: Bad string".

OpenServer 5.0.0

Written · Last revised

Problem

I am running a script that uses tr(C) to translate characters
received from stdin and passed to stdout.  Issuing this command:
tr "[\201-\377]" "[\001-\177]"
results in this error message:
tr: Bad string

This command worked correctly on SCO UNIX System V/386 Release 3.2 Operating System Version 4.2.

Solution

This problem has been resolved in SCO OpenServer Release 5.0.4 and
5.0.5.
As a workaround, use the mapping:
tr "[\201-\376][\377]" "[\001-\176][\177]"

From the Xinuos technical article database, record 104912. Reproduced with permission. The original is at www.sco.com/ta/104912, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

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.