Quick: Unix shell scripts, which sets environment vars
Tim Cummings
tim.cummings@frequencymarketing.com
Thu, 21 Aug 2003 15:47:48 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C3681D.192521B0
Content-Type: text/plain;
charset="iso-8859-1"
Ole,
In your script, after setting the environment variables, I think if you
follow them with "export" commands, it will make those environment variables
available to the entire process tree.
Tim Cummings
-----Original Message-----
From: Ole Hansen, ScanConsult [mailto:oh@scanconsult.dk]
Sent: Thursday, August 21, 2003 2:21 PM
To: 'Rohde Dirk'
Cc: powerh-l@lists.swau.edu
Subject: RE: Quick: Unix shell scripts, which sets environment vars
Hi Dirk,
Yes - of course Quick has already started a child process; thanks for
pointing this out.
I will have to let the script write the result to a file or a table in the
database, where I can read it from Quick.
Mange hilsner / With kind regards
Ole Hansen
===========================================================
E-mail: oh@scanconsult.dk Cell Phone: +45 4040 1150
===========================================================
ScanConsult IT-Partners ApS Voice : +45 8738 7474
Jegstrupvej 96A Fax : +45 8738 7475
DK-8361 Hasselager Support : support@scanconsult.dk
Denmark Sales : sales@scanconsult.dk
http://www.scanconsult.dk
= ParaSuite : A Suite of Air Cargo Handling solutions =
= ParaSafe : A Suite of IT-Security solutions =
= Partners : Hewlett-Packard, Cognos, Microsoft and more =
-----Original Message-----
From: powerh-l-admin@cube.swau.edu [mailto:powerh-l-admin@cube.swau.edu] On
Behalf Of Rohde Dirk
Sent: 21. august 2003 17:41
To: 'oh@scanconsult.dk'
Cc: powerh-l@lists.swau.edu
Subject: RE: Quick: Unix shell scripts, which sets environment vars
I'm not sure what is causing the error (check your file protection), but I
believe that Quick starts a child process for any "run command" procedure.
Thus, even if you are able to "dot" a script, you would still lose the
environment variables upon return. The solution is to either use the
"setsystemval" command or to set and export your environment variables
before starting Quick.
-----Original Message-----
From: Ole Hansen, ScanConsult [mailto:oh@scanconsult.dk]
Sent: Thursday, August 21, 2003 3:10 AM
To: powerh-l@lists.swau.edu
Subject: Quick: Unix shell scripts, which sets environment vars
Hi all,
I need to execute a shell script from Quick, and retrieve the environment
variables, set by the script.
The script works and the variables is set in the calling process when run
manually from the shell with a dot preceeding the scriptname (.
<scriptname>) but when I try from Quick using RUN COMMAND ". <scriptname>"
it fails with an exit status of 126.
It is the leading dot, that causes the error because when I try RUN COMMAND
"<scriptname>", I get no errors - but the environment variables set by the
script are of course not available to GETSYSTEMVAL afterwards.
So I guess that my problem can be re-phrased to: How does one execute a
shell command from Quick using the same shell instance as Quick runs in?
Any help will be highly appreciated.
Mange hilsner / With kind regards
Ole Hansen
===========================================================
E-mail: oh@scanconsult.dk Cell Phone: +45 4040 1150
===========================================================
ScanConsult IT-Partners ApS Voice : +45 8738 7474
Jegstrupvej 96A Fax : +45 8738 7475
DK-8361 Hasselager Support : support@scanconsult.dk
Denmark Sales : sales@scanconsult.dk
http://www.scanconsult.dk
= ParaSuite : A Suite of Air Cargo Handling solutions =
= ParaSafe : A Suite of IT-Security solutions =
= Partners : Hewlett-Packard, Cognos, Microsoft and more =
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber. = =
= = = = = = = = = = = = = = = = = = = = = = = = = = Mailing list:
powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
------_=_NextPart_001_01C3681D.192521B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: Quick: Unix shell scripts, which sets environment =
vars</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Ole,</FONT>
</P>
<P><FONT SIZE=3D2>In your script, after setting the environment =
variables, I think if you follow them with "export" commands, =
it will make those environment variables available to the entire =
process tree.</FONT></P>
<P><FONT SIZE=3D2>Tim Cummings</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Ole Hansen, ScanConsult [<A =
HREF=3D"mailto:oh@scanconsult.dk">mailto:oh@scanconsult.dk</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, August 21, 2003 2:21 PM</FONT>
<BR><FONT SIZE=3D2>To: 'Rohde Dirk'</FONT>
<BR><FONT SIZE=3D2>Cc: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subject: RE: Quick: Unix shell scripts, which sets =
environment vars</FONT>
</P>
<P><FONT SIZE=3D2>Hi Dirk,</FONT>
</P>
<P><FONT SIZE=3D2>Yes - of course Quick has already started a child =
process; thanks for</FONT>
<BR><FONT SIZE=3D2>pointing this out.</FONT>
</P>
<P><FONT SIZE=3D2>I will have to let the script write the result to a =
file or a table in the</FONT>
<BR><FONT SIZE=3D2>database, where I can read it from Quick.</FONT>
</P>
<P><FONT SIZE=3D2>Mange hilsner / With kind regards</FONT>
</P>
<P><FONT SIZE=3D2>Ole Hansen</FONT>
</P>
<P><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>E-mail: =
oh@scanconsult.dk Cell =
Phone: +45 4040 1150</FONT>
<BR><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>ScanConsult IT-Partners =
ApS Voice : =
+45 8738 7474</FONT>
<BR><FONT SIZE=3D2>Jegstrupvej =
96A &nb=
sp; =
Fax : +45 8738 7475</FONT>
<BR><FONT SIZE=3D2>DK-8361 =
Hasselager Support : =
support@scanconsult.dk</FONT>
<BR><FONT =
SIZE=3D2>Denmark &n=
bsp; =
Sales : sales@scanconsult.dk</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; <A HREF=3D"http://www.scanconsult.dk" =
TARGET=3D"_blank">http://www.scanconsult.dk</A> &=
nbsp; </FONT>
<BR><FONT SIZE=3D2>=3D ParaSuite : A Suite of Air Cargo Handling =
solutions =3D</FONT>
<BR><FONT SIZE=3D2>=3D ParaSafe : A Suite of IT-Security =
solutions =
=3D</FONT>
<BR><FONT SIZE=3D2>=3D Partners : Hewlett-Packard, Cognos, =
Microsoft and more =3D</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: powerh-l-admin@cube.swau.edu [<A =
HREF=3D"mailto:powerh-l-admin@cube.swau.edu">mailto:powerh-l-admin@cube.=
swau.edu</A>] On</FONT>
<BR><FONT SIZE=3D2>Behalf Of Rohde Dirk</FONT>
<BR><FONT SIZE=3D2>Sent: 21. august 2003 17:41</FONT>
<BR><FONT SIZE=3D2>To: 'oh@scanconsult.dk'</FONT>
<BR><FONT SIZE=3D2>Cc: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subject: RE: Quick: Unix shell scripts, which sets =
environment vars</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>I'm not sure what is causing the error (check your =
file protection), but I</FONT>
<BR><FONT SIZE=3D2>believe that Quick starts a child process for any =
"run command" procedure.</FONT>
<BR><FONT SIZE=3D2>Thus, even if you are able to "dot" a =
script, you would still lose the</FONT>
<BR><FONT SIZE=3D2>environment variables upon return. The solution is =
to either use the</FONT>
<BR><FONT SIZE=3D2>"setsystemval" command or to set and =
export your environment variables</FONT>
<BR><FONT SIZE=3D2>before starting Quick.</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Ole Hansen, ScanConsult [<A =
HREF=3D"mailto:oh@scanconsult.dk">mailto:oh@scanconsult.dk</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, August 21, 2003 3:10 AM</FONT>
<BR><FONT SIZE=3D2>To: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subject: Quick: Unix shell scripts, which sets =
environment vars</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hi all,</FONT>
</P>
<P><FONT SIZE=3D2>I need to execute a shell script from Quick, and =
retrieve the environment</FONT>
<BR><FONT SIZE=3D2>variables, set by the script.</FONT>
</P>
<P><FONT SIZE=3D2>The script works and the variables is set in the =
calling process when run</FONT>
<BR><FONT SIZE=3D2>manually from the shell with a dot preceeding the =
scriptname (.</FONT>
<BR><FONT SIZE=3D2><scriptname>) but when I try from Quick using =
RUN COMMAND ". <scriptname>"</FONT>
<BR><FONT SIZE=3D2>it fails with an exit status of 126.</FONT>
</P>
<P><FONT SIZE=3D2>It is the leading dot, that causes the error because =
when I try RUN COMMAND</FONT>
<BR><FONT SIZE=3D2>"<scriptname>", I get no errors - =
but the environment variables set by the</FONT>
<BR><FONT SIZE=3D2>script are of course not available to GETSYSTEMVAL =
afterwards.</FONT>
</P>
<P><FONT SIZE=3D2>So I guess that my problem can be re-phrased to: How =
does one execute a</FONT>
<BR><FONT SIZE=3D2>shell command from Quick using the same shell =
instance as Quick runs in?</FONT>
</P>
<P><FONT SIZE=3D2>Any help will be highly appreciated.</FONT>
</P>
<P><FONT SIZE=3D2>Mange hilsner / With kind regards</FONT>
</P>
<P><FONT SIZE=3D2>Ole Hansen</FONT>
</P>
<P><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>E-mail: =
oh@scanconsult.dk Cell =
Phone: +45 4040 1150</FONT>
<BR><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>ScanConsult IT-Partners =
ApS Voice : =
+45 8738 7474</FONT>
<BR><FONT SIZE=3D2>Jegstrupvej =
96A &nb=
sp; =
Fax : +45 8738 7475</FONT>
<BR><FONT SIZE=3D2>DK-8361 =
Hasselager Support : =
support@scanconsult.dk</FONT>
<BR><FONT =
SIZE=3D2>Denmark &n=
bsp; =
Sales : sales@scanconsult.dk</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; <A HREF=3D"http://www.scanconsult.dk" =
TARGET=3D"_blank">http://www.scanconsult.dk</A> &=
nbsp; </FONT>
<BR><FONT SIZE=3D2>=3D ParaSuite : A Suite of Air Cargo Handling =
solutions =3D</FONT>
<BR><FONT SIZE=3D2>=3D ParaSafe : A Suite of IT-Security =
solutions =
=3D</FONT>
<BR><FONT SIZE=3D2>=3D Partners : Hewlett-Packard, Cognos, =
Microsoft and more =3D</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D</FONT>
<BR><FONT SIZE=3D2>Mailing list: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: "subscribe" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: "unsubscribe =
<password>" in message body to</FONT>
<BR><FONT SIZE=3D2>powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber. =3D =3D</FONT>
<BR><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D Mailing =
list:</FONT>
<BR><FONT SIZE=3D2>powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: "subscribe" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: "unsubscribe =
<password>" in message body to</FONT>
<BR><FONT SIZE=3D2>powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber.</FONT>
</P>
<P><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D</FONT>
<BR><FONT SIZE=3D2>Mailing list: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: "subscribe" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: "unsubscribe =
<password>" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber.</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C3681D.192521B0--