environment variables - qdesign
Joe Boyle
atla38 at dsl.pipex.com
Thu Dec 8 09:30:37 CST 2005
Mark Fry sent the details below to the list a while back,
Well it's been a while, but I remember going round this loop a number of
years ago.
You want to execute tests1 in the same shell? Hmmm... The problem is
that when you issue a RUN COMMAND, your current process is not in the
original shell, but rather a child of the quick process used to fire up
the screen in the first place. If you want your command to run in a
shell, you have to ask for it (ie fork a new shell below your quick
process by doing RUN COMMAND "sh -c '. test1'"). Of course, as soon as
the RUN COMMAND has finished, you drop back to the quick process (ie
your screen) and lose whatever variables were set in your forked shell.
>From within your screen, you cannot make changes to the original shell
you were in before you started the screen, as it is the parent process
of your screen, which in turn is the parent process of whatever you ask
for in your RUN COMMAND. You can see this effectively if you issue a
RUN COMMAND "ksh" from quick. When you run the command, you fork a new
shell. It's parent is not your original shell, but rather the quick
process for your screen (do a ps -f to see this).
Looks like you will need to source tests1 before you launch quick, or
else look at using the SETSYSTEMVAL function to set the environment
variables instead of using your script.
Hope this clarifies things a bit.
Regards, Joe.
-----Original Message-----
From: Portelance, Pierre (Montreal) [mailto:portelancp at bowater.com]
Sent: 08 December 2005 14:41
To: Joe Boyle
Subject: RE: environment variables - qdesign
we tried the uppercase with no success and that variable has to be setup
throught the export command.
Here is the code if it can help
-----------------------------------------------------------------
SCREEN zzzz.qkc
temp t-zzzz char*50
FIELD t-zzzz
procedure internal zzzz
begin
IF NOT SETSYSTEMVAL ("LINEIN","EMPTY")
THEN ERROR "error setsystemval"
run command 'zzzz.ksh' nowarn clear screen &
refresh screen on error continue
let t-zzzz = getsystemval("LINEIN")
info = 't-zzzz = ' + t-zzzz NOW RES
end
procedure input t-zzzz
begin
if fieldtext = 'x'
then do internal zzzz
end
build
-------------------------------------------------------------------
and the script zzzz.ksh
export LINEIN=hello
Thanks
-----Original Message-----
From: Joe Boyle [mailto:atla38 at dsl.pipex.com]
Sent: Thursday, December 08, 2005 9:25 AM
To: Portelance, Pierre (Montreal); powerh-l at lists.sowder.com
Subject: RE: environment variables - qdesign
It is probably just a case thing, set everything as uppercase as a general
test.
Failing that, and assuming that the two commands are executed in the same
process, you could try setsystemval in place of the 'run command'.
That said, you can't set a variable in a lower process and then find it
after returning to a higher process level.
Regards, Joe.
-----Original Message-----
From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
Portelance, Pierre (Montreal)
Sent: 08 December 2005 14:04
To: powerh-l at lists.sowder.com
Subject: environment variables - qdesign
If I issue a RUN COMMAND that EXPORT a variables under Unix, the next
GETSYSTEMVAL of the variable doesn't work.
Any ideas..
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request at lists.sowder.com
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
More information about the powerh-l
mailing list