FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


launching shell scripts from jython/python





mike_phi
Hi there I am launching linux shell scripts from a jython application, basically I would like to know how I can capture the output from te shell script in the jython environment.

in the case where i was calling the shell script from another script I would do the following to capture the output

#!/usr/sh

.
.
./innerscript.sh 2>&1 outputfile.text

which will take all the outputs from the inner script and put them in the outer script how do i achieve a similar effect if the inner script was being called f4om within a jython script.

cheers
MrBlueSky
Use popen to create a pipe. See http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/python/lib/os-newstreams.html#os-newstreams for more information.
mike_phi
Thanks allot, will certainly look into this and try it out on my prototype

cheers
Related topics
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.