Clicky

Solaris 10 x86 tr bad string

Solaris 10 x86 tr bad string

Hello,
I was searching for problem with tr command.
I had a problem on Solaris 10 x86 that scripts with command’s:
calluser=`/usr/xpg4/bin/id -u -n`
calluser=`echo $calluser | tr “[:lower:]” “[:upper:]”`

Was returning Bad string result.

I found on net solution to replace “[:lower:]” “[:upper:]”
with “[a-z]” “[A-Z]”.
This solution works fine if u don’t need to update many scripts each time. So I found problem in my case that I had local variable LC_CTYPE=hr_HR.UTF-8.

So I went to /etc/default/init and commented all local settings to look like:
TZ=Europe/Zagreb
CMASK=022
#LC_COLLATE=hr_HR.UTF-8
#LC_CTYPE=hr_HR.UTF-8
#LC_MESSAGES=C
#LC_MONETARY=hr_HR.UTF-8
#LC_NUMERIC=hr_HR.UTF-8
#LC_TIME=hr_HR.UTF-8

And after that tr command was working perfect!