"tr" command not working properly in test environm
Posted: Sat Oct 27, 2012 9:59 am
Hi All
we are having an issue in one of the DS env(test) where in "tr" commands in scripts are not getting parsed correctly causing failures.
To deal with that, I made a trivial script that inputs an argument and converts it into uppercase using "tr" (like in actual scripts) as below:
COUNTRY_CODE=$1
which tr
set
echo $COUNTRY_CODE
COUNTRY_CODE=`echo ${COUNTRY_CODE} | tr [a-z] [A-Z]`
echo $COUNTRY_CODE
and it's giving the same error in log, as below:
_=tr
ab
Usage: tr [ -cds ] [ String1 [ String2 ] --where "ab" was the input argument to script.
"tr" works fine as such on unix. Also, exported job to UAT and it works fine there. The only difference i could see is that in UAT, it runs as bourne shell(sh) while in test, it runs as ksh. Default shell on both servers is ksh but dsenv file is setting the default as bourne(using and both dsenv files are same(being generic).
Have couple of questions here:
1. what could be the reason that shell is not set to bourne in test env?
2. when i see the 'enviornment variable settings' event in log: I see shell only in test(as ksh) but SHELL variable is not thrown in UAT. I had to use "set" in the test script(as above) to see what shell is being used. why is it so ?
any help would be appriciated.
we are having an issue in one of the DS env(test) where in "tr" commands in scripts are not getting parsed correctly causing failures.
To deal with that, I made a trivial script that inputs an argument and converts it into uppercase using "tr" (like in actual scripts) as below:
COUNTRY_CODE=$1
which tr
set
echo $COUNTRY_CODE
COUNTRY_CODE=`echo ${COUNTRY_CODE} | tr [a-z] [A-Z]`
echo $COUNTRY_CODE
and it's giving the same error in log, as below:
_=tr
ab
Usage: tr [ -cds ] [ String1 [ String2 ] --where "ab" was the input argument to script.
"tr" works fine as such on unix. Also, exported job to UAT and it works fine there. The only difference i could see is that in UAT, it runs as bourne shell(sh) while in test, it runs as ksh. Default shell on both servers is ksh but dsenv file is setting the default as bourne(using and both dsenv files are same(being generic).
Have couple of questions here:
1. what could be the reason that shell is not set to bourne in test env?
2. when i see the 'enviornment variable settings' event in log: I see shell only in test(as ksh) but SHELL variable is not thrown in UAT. I had to use "set" in the test script(as above) to see what shell is being used. why is it so ?
any help would be appriciated.