Re: Problem with Runtime.exec() and compound commands in Solaris



ezjlxp wrote On 04/12/07 09:21,:
I'm trying to use Java's Runtime.exec() to call some unix commands in
an uninstaller. For reasons I don't have time to explain, making a
call to a shell script which executes the unix commands isn't an
option.

In the uninstall process i'm trying to execute the follow unix
compound command:

rmdir /directory >> /tmp/uninstall.log 2>&1

if I run this command from a terminal it runs as expected. If the
directory isn't empty it prints a message to the uninstall.log file.
However, when I try to pass this into the exec command it never writes
the error message to the log file when the directory is not empty.
[...]

Multiple choice: When you run the command from a
terminal, what agency arranges for the I/O redirection?

a) The rmdir program executable
b) The Unix kernel
c) The National Security Agency
d) Windows Media Player
e) The shell

True or false: The rmdir program automatically runs
a shell.

Essay question: Describe how to start a shell and
instruct it to execute one command, with all the I/O
redirection, filename globbing, and other goodies one
usually expects from a shell.

Any help would be greatly appreciated. Thank you!

You're welcome. I hope this helps.

--
Eric.Sosman@xxxxxxx
.



Relevant Pages

  • Re: Redirection issue
    ... 1- execute input commands from standard input, ... the phrase "it does not work anymore" carries very little meaning. ... after compilation and execution of the shell with a simple command like ... all the command in the file are executed as well. ...
    (comp.lang.c)
  • Re: Redirection issue
    ... 1- execute input commands from standard input, ... the phrase "it does not work anymore" carries very little meaning. ... after compilation and execution of the shell with a simple command like ... all the command in the file are executed as well. ...
    (comp.lang.c)
  • Re: shell scripting
    ... and am assuming an sh-compatible shell here.... ... command 1 options arguments ... To run the script, do: ... then you need to use the full path to execute it: ...
    (comp.unix.questions)
  • Re: shell scripting
    ... and am assuming an sh-compatible shell here.... ... command 1 options arguments ... To run the script, do: ... then you need to use the full path to execute it: ...
    (comp.unix.shell)
  • Re: Lisp/Unix impedance [a programming challenge]
    ... >> I don't think you even have any idea what Unix is. ... nice if using a command shell under Windows didn't feel like working ... with blinders on a command line that's been made deliberately hard to ... An Emacs over a *nix shell is pretty usable at controlling ...
    (comp.lang.lisp)