I have a program that can run normally via the CALL command or within
QSH via a symbolic link. I want the default output to be different
depending on where it is running. I do not want the user to have to
do
anything special external to the program. It must be transparent.

Do you know the value of $SHELL when the program is called from command
line vs. from QSH? Will that give you a clue?

One thing to consider: your link doesn't HAVE to be symbolic to the
program object, does it? Couldn't it be a script that sets up
overriding parameters (perhaps simply by setting some environment
variable) and then links to the program object (perhaps with a special
command-line switch)? Does that help? Of course the issue there is
that environment variables can also be set from the ADD/CHG/RMV ENVVAR
command set and flags can be passed from CALL, which violates the
absolutely/positively aspect of your question. But maybe (if $SHELL is
a clue) the combination can be absolute? Hmmm...

Answering my own question... if you did call the program from a script, and
then (from your program) checked the parent process, you should find that
the parent process is that script. If it's not that script, then it's
either a CALL command or someone is violating your protocol. Right?

D

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
MIAMI MAN ADMITS TAKING HIS OWN LIFE
-- headline from the Orlando (Florida) Sentinel



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-2021 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.