Menu

#229 tr [:upper:] [:lower:] yields Bad String in Solaris

v3.3.9
closed-fixed
nobody
5
2014-11-12
2009-12-07
Anonymous
No

tr [:upper:] [:lower:] | tr -d [:blank:] yields Bad string in SunOS 5.10 (Solaris 10)

the work-around is:
tr [A-Z] [a-z] | tr -d ' '

Discussion

  • Christian Mueller

    Hello,

    Can you please provide me your output of 'uname -a' and locale?

    I think this is a locale relating problem as the tr works fine on my Solaris 5.10 with C environment.

    Looking forward for your reply.
    Christian

     
  • Phil Xue

    Phil Xue - 2009-12-08

    output of our 'uname -a':
    SunOS sun1 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Blade-1000

    and our locale:
    LANG=
    LC_CTYPE=en_NZ.UTF-8
    LC_NUMERIC=en_NZ.UTF-8
    LC_TIME="C"
    LC_COLLATE=en_NZ.UTF-8
    LC_MONETARY=en_NZ.UTF-8
    LC_MESSAGES=en_NZ.UTF-8
    LC_ALL=

    /usr/bin/tr fails with Bad string error, but /usr/xpg4/bin/tr works

     
  • Christian Mueller

    Phil,

    Thank you for your reply.
    Running the script on Solaris within a non singlebyte locale causes the error you described.

    I changed the shell script according to your workaround. The changes will be part of the 3.4.0 release.

    Thank you very much,
    Christian

     
  • Christian Mueller

    • status: open --> closed-fixed
     

Log in to post a comment.