LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   RHEL5 braceexpand in KSH not working the same as RHEL4 HELP! (https://www.linuxquestions.org/questions/programming-9/rhel5-braceexpand-in-ksh-not-working-the-same-as-rhel4-help-627292/)

kcarmi01 03-11-2008 12:57 PM

RHEL5 braceexpand in KSH not working the same as RHEL4 HELP!
 
On my RHEL4 system i was able to write a KSH script and set enviornment varibales by doing the following:
set +o braceexpand (turns off braces)
CLUSTER_NODES='{"usplselux140","usplselux141"}'
echo $CLUSTER_NODES
{"usplselux140","usplselux141"}
variable is set as wanted and looks like above echo output! I require the enviroment variable to be exactly like the output.

Now i have moved on to Linux 5 and doing the same thing i get the wrong output with braceexpand turned off as in RHEL4.

set +B braceexpand
set -o
Current option settings
braceexpand off
set +o seems to the do the same and turns off braceexpand
but the output of the same above is different.

Output: ksh shell environment settings

CLUSTER_NODES='{"usplselux140","usplselux141"}'
echo $CLUSTER_NODES
"usplselux140" "usplselux141"

It has stripped the brackets and pulled the comma seperator as well. no matter what i do to braceexpand it doesn't come out like i need and it did in RHEL4.

We are running RHEL AS x86_64 OS versions for 4 and 5.

You help is appreciated.

MensaWater 03-11-2008 07:43 PM

The ksh on RHEL4 is pdksh which isn't the one on RHEL5. (You can verify what you have with rpm -qa |grep ksh).

It may be that what you're doing works in pdksh but not the other ksh (maybe a bug). Maybe installing pdksh on the RHEL5 box would help.

kcarmi01 03-12-2008 04:51 PM

wrong response

kcarmi01 03-12-2008 04:53 PM

i talked to the SA and there is not a pdksh available for RHEL5 and that on the ksh is ksh93 which is a major rewrite of ksh for RHEL5 and is the first version of ksh available as Open Source. They are telling me it is the way it is and i can not find a way to make it work the way it was without rewriting lots of code. ksh on solaris systems and other are using ksh88. I was trying for consistent code cross platform. Guess that was wishful thinking.. Any other sugestions welcomed.

MensaWater 03-13-2008 07:36 PM

Quote:

Originally Posted by kcarmi01 (Post 3086636)
wrong response

You are the rudest moron to ever post.

My response was NOT wrong. For your information I AM an SA and have been since 1991.

pdksh is "public domain korn shell" and as a "public domain" is "available" for any distro someone cares to take the effort to put it on. Your admin obviously realizing what Luser you are and not wanting to support two versions of ksh simply told you whatever he had to to make you go away.

Even if I had been wrong it would have been polite to simply thank me for my response then ask for further information but I guess your mom didn't raise you correctly.

:tisk:


All times are GMT -5. The time now is 04:42 AM.