Re: Shell output vs Process streams



On 27 Jul 2005 12:49:42 -0700, Marcus Leon wrote:
> 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.

Aside from the apparent errors in the script based on the output
you've provided, I suspect the environment seen by the script is
different when run from Java than when run from the command line.

Not really a java issue, but perhaps you should read the manpage for
your shell, and look for things explaining the differences between
interactive and non-interactive shells, and login and non-login
shells.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: export question
    ... -- export JAVA ... the script doesn't spawn a new shell so the export command is executed ... If you execute the shell script in your current ...
    (Debian-User)
  • Re: error on which command in bash
    ... >> I don't see this message on any other command. ... > which will not work in other shells. ... my which script was missing a ". ... This particular machine has the most up-to-date patches on it, ...
    (comp.unix.shell)
  • Re: Expect script
    ... >> I'm developing a program in expect script and it makes a call to java ... How can I find out the java pid? ... > the original spawn command. ...
    (comp.lang.tcl)
  • Re: Why alias cannot run by shell script?
    ... I added the 'x' permission and it can be executed ... > message 'command not found' occurred. ... them sparingly in interactive shells). ... in the script; it will be easier to read and understand.) ...
    (comp.unix.shell)
  • Re: Rhino: Script runs from command line, but not from browser
    ... If you want to execute the script from the command line: ... I used the browser as an example: ... JavaScript being written in Java does not make it a Java only ...
    (comp.lang.javascript)