Mailing List - Entries from 2018 up to now
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000099">
Hi Zsolt,<br>
<br>
You can use these lines in a Jython Server Script:<br>
<br>
<i>import os<br>
<br>
fullCommand = 'your command'<br>
f = os.popen(fullCommand)<br>
output = f.read()<br>
f.close()</i><br>
<br>
Just stick the command you want to execute and you will get the
output as a string inside the <i>output</i> variable.<br>
Not too sure if stderr is grabbed as well though.<br>
<br>
Cheers,<br>
<div class="moz-signature">
<p style="font-family:arial;font-size:12px;color:#808080;"><b
style="color:#0000FF;">Denis GAUTHIER</b></p>
<br>
</div>
On 14/02/2012 8:18 PM, Berg, Klaus-Peter wrote:
<blockquote
cite="mid:FF7F5B35B59377448EA7B9F4F97E9B530B730DBBDF@DEMCHP99E15MSX.ww902.siemens.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19170">
<!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<style>@font-face {
font-family: Calibri;
}
@font-face {
font-family: Tahoma;
}
@font-face {
font-family: GE Inspira Pitch;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 70.85pt 70.85pt 70.85pt 70.85pt; }
P.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US
}
LI.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US
}
DIV.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
LI.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
DIV.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
P.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US; mso-style-priority: 34
}
LI.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US; mso-style-priority: 34
}
DIV.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-fareast-language: EN-US; mso-style-priority: 34
}
SPAN.EmailStyle18 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: windowtext; mso-style-type: personal
}
SPAN.EmailStyle19 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal-reply
}
SPAN.BalloonTextChar {
FONT-FAMILY: "Tahoma","sans-serif"; mso-fareast-language: EN-US; mso-style-priority: 99; mso-style-link: "Balloon Text"; mso-style-name: "Balloon Text Char"
}
.MsoChpDefault {
FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.WordSection1 {
page: WordSection1
}
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div dir="ltr" align="left"><span class="001220809-14022012"><font
color="#0000ff" face="Arial" size="2">Hello Hajnal,</font></span></div>
<div dir="ltr" align="left"><span class="001220809-14022012"></span> </div>
<div dir="ltr" align="left"><span class="001220809-14022012"><font
color="#0000ff" face="Arial" size="2">I guess since Java 5
you can use the java.lang.ProcessBuilder class.</font></span></div>
<div dir="ltr" align="left"><span class="001220809-14022012"><font
color="#0000ff" face="Arial" size="2">ProcessBuilder.start()
returns a Process object, where you can call:
getOutputStream() , getErrorStream().</font></span></div>
<div dir="ltr" align="left"><span class="001220809-14022012"></span> </div>
<div dir="ltr" align="left"><span class="001220809-14022012"><font
color="#0000ff" face="Arial" size="2">Unfortenately I have
no Jython script example like the one you are using now:</font></span></div>
<p class="MsoNormal"><span style="COLOR: #1f497d">import os</span><span
style="COLOR: #1f497d"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d">os.system(’systeminfo
> temp.txt’)</span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d"><o:p><span
class="001220809-14022012">I'm using Groovy instead of
Jython with respect to QF-Test...</span></o:p></span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d"><o:p><span
class="001220809-14022012"></span></o:p></span> </p>
<p class="MsoNormal"><span style="COLOR: #1f497d"><o:p><span
class="001220809-14022012">Best regards</span></o:p></span></p>
<p class="MsoNormal"><span style="COLOR: #1f497d"><o:p><span
class="001220809-14022012">Klaus Peter</span></o:p></span></p>
<br>
</blockquote>
-------------------------------------------------------------------------
DISCLAIMER: This e-mail transmission and any documents, files and
previous e-mail messages attached to it are private and confidential.
They may contain proprietary or copyright material or information that
is subject to legal professional privilege. They are for the use of
the intended recipient only. Any unauthorised viewing, use, disclosure,
copying, alteration, storage or distribution of, or reliance on, this
message is strictly prohibited. No part may be reproduced, adapted or
transmitted without the written permission of the owner. If you have
received this transmission in error, or are not an authorised recipient,
please immediately notify the sender by return email, delete this
message and all copies from your e-mail system, and destroy any printed
copies. Receipt by anyone other than the intended recipient should not
be deemed a waiver of any privilege or protection. Thales Australia
does not warrant or represent that this e-mail or any documents, files
and previous e-mail messages attached are error or virus free.
-------------------------------------------------------------------------
</body>
</html>