× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



First, thanks for your patience and, if you are ever wondering about writing an article and needing an idea, an article about the all the AIX environment lingo and what they mean would be great. Differentiating between programs run through Qshell and QP2Term. Understanding what the different AIX and AIX-like environments can do, what they support and how to access them would be great. I have tried to build an FAQ from posts here in Midrange, but, as you no doubt have noticed, I still have a lot of learning to do. (Perhaps you already have such an article and I just missed it...)

OK! So it is a shell issue. What I may do for this particular implementation then is to write a CL to wrap the STRQSH command passing the 'export' command with the variables I defined. I'll put a command in front of that and that will take care of it. What I am attempting to simplify are the steps need to handle a change in the base folder of this application. If the folder changes from /MyPgm to /MyPgm1 then changing just the value in the MY_HOME variable is what I am after. So, your suggestion is great, I just need to make it a bit more bullet proof by wrapping in some code. That way the user won't fat finger a value and have the program crash. (Well, they *could* fat finger the variable value but, you get the drift....)

Thanks for all the help.

Pete


Scott Klement wrote:
Hi Pete,

Hmmm. As usual I get a bit confused in the i(ntegrated) world we live in on the System i. What threw me off, and lead me down the wrong path, is that the variables I set using WRKENVVAR are all available when I start Qshell, which led me to mistakenly believe that variable substitution would work in Qshell using those variables I set before I started Qshell. Well, since they ARE accessible to QShell it would be a nice enhancement if they functioned similarly to the way other Environment Variables do in Windows and Linux.

With all due respect... they DO work the way environment variables do in Windows and Linux. The dollar-sign inserting the value of an environment variable is NOT a feature of environment variables. It's a feature of the shell.

Qshell supports them exactly the way you want them to be supported... Just CL Does not. I guess I don't understand why this is a problem for you since you're running a QShell command to begin with.

You don't necessarily have to use a shell script. You can set the variable, then run your AIX utility all in one call to QSH like this:

ADDENVVAR ENVVAR(MY_HOME) VALUE('/foo') REPLACE(*YES)

STRQSH CMD('export CLASSPATH=$CLASSPATH:$MY_HOME; +
/path/to/your-aix-thing')

So this adds /foo to the classpath, then calls your AIX thing in one call to QShell. If you like, you can even do the ADDENVVAR separately (perhaps interactively via WRKENVVAR if that's what you're going for.)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.