Operating System - HP-UX
1834070 Members
3131 Online
110063 Solutions
New Discussion

upper working on one system but not in another

 
MAD_2
Super Advisor

upper working on one system but not in another

I came up into a very irritating situation in which a portion of a script is working in one system but not working in another. Here is the segment in question:

============================================================
BRANCH=NONE

while echo "Enter branch #, or command, or help (Current branch = $BRANCH): \c"
read COMMAND
do
COMMAND=`upper \"$COMMAND\"`

case $COMMAND in
### change branch

[F,P,M,T,A,C,S,Z,R]*) FIELD=`echo $COMMAND | awk '{print $1}'`
VALUE=`echo $COMMAND | awk '{print $2}'`

if [ "$HAVEBRANCH" = "Y" ]
then PARMFILE=bmaint.$$

echo "$BRANCH|$COMMAND" > /tmp/$PARMFILE
echo "\n"

sqlplus -s $IMALOGIN @branch_upd.pl $PARMFILE
echo "\n" sqlplus -s $IMALOGIN @bchlist.pl $BRANCH

echo "\n"
else
echo "\nBranch must be specified!\n"
fi;;

HELP) cat branch_maint.hlp;;

============================================================


The code is the same in two machines, one is an RP5470 and the other is an HP9000, both have 64 bit HP-UX 11.00. However, the piece of code with "upper" only works on the RP5470 and it's not working on the HP9000. Why?

I have managed to resolve the problem by substituing the portion:

COMMAND=`upper \"$COMMAND\"`

With:

typeset -u COMMAND

This above the "read COMMAND". However, I am still puzzled why it works on one but not the other.

Please, any clues are appreciated.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
2 REPLIES 2
MAD_2
Super Advisor

Re: upper working on one system but not in another

Oh, by the way, I forgot to mention that I kept testing this only with the "HELP" portion of the case control structure. I was typing lower case "help"+CR and the system would just hang, nothing would happen. It would not execute the cat of the help text file.

But this was working on the other system.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: upper working on one system but not in another

Oh, no sweat. I found where the problem was happening.

This upper was an internal utility which converts lower to upper case by use of PL/SQL code and was not well documented. The login required for the PL/SLQ code to execute was not changed in the system in question and that is why it was failing.

Thanks!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with