Shell output vs Process streams



I'm trying to call a shell script from Java and read the script output.
Right now I get different text when I run the script from the command
line vs. when I run it from Java using the Process class. Does anyone
know why? Thanks.

Output From Command Line:
UID: readonly variable
ambiguous redirect
continue: only meaningful in a `for', `while', or `until' loop

Process.getErrorStream() Text:
/export/home/weblogic/fullexport.sh:
ORACLE_HOME=/u01/app/oracle/product/9.2.0: is not an identifier

Process.getInputStream() Text:
<blank>

My Java Program:
Process proc = Runtime.getRuntime().exec(args[0]) ;

BufferedReader br1 = new BufferedReader(new
InputStreamReader(proc.getErrorStream()));
while ((str = br1.readLine()) != null) {
error += (str + "\n");
}

BufferedReader br2 = new BufferedReader(new
InputStreamReader(proc.getInputStream()));
while ((str = br2.readLine()) != null) {
input += (str + "\n");
}

.



Relevant Pages

  • Re: image gallery
    ... Does this mean i dont have to modify the second part of the script - telling ... If your pictures are stored in your images folder, ... pictures like the FP Banner web component but will be visible to users ... Being in Java doesn't usually / neccessarily mean insecure. ...
    (microsoft.public.frontpage.addins)
  • Re: [opensuse] Editting PATH variable
    ... SuSEconfig script ... ... not knowing what you options you used to install ... If your unfamiliar with Bash a good book is 'Learning the Bash Shell' by ... For Java use editing the PATH variable is NOT required... ...
    (SuSE)
  • Re: JAvascripts not working in my computer
    ... I have all my java enabled in the ... >> Script Debugging Problem ... >> Sun JRE.) ... >> Sun also offers an automatic download and install of the 1.4 Java ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: file not found or server unavailable web site links
    ... and definely looks like a virus writter script deletion ... >> There is an apparent java script error with IE6. ... the Sun JRE.) ... >Sun also offers an automatic download and install of the ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: JavaScript window.open() can not hide status bar
    ... > Script Debugging Problem ... > Where to get the JAVA VM ... > Sun also offers an automatic download and install of the 1.4 Java plug-in ... > checks whether the browser can handle Shockwave Flash so I suspect there may ...
    (microsoft.public.windows.inetexplorer.ie6.browser)