Hi,
I tried the same thing some time ago.
The problem is, exec works, for example if you try exec("ls") you wont get
problems. However, running anything as a command that has a
redirection of out-/ input in it fails.
I don't know why, but that's what I experienced.
Anybody knows why ???
Mark
Marius Schamschula wrote:
> Hi there,
>
> I am having trouble getting Runtime.exec () to do anything (yes I do send
> the desired command as an argument...e.g. "/bin/ls /home/someusr/dir >
> /home/someusr/test"). I've tested my code on both a mkLinux (DR2.1u5) and
> Debian Linux machine running various flavors of JDK 1.1.x. I'm trying to use
> Java to directly invoke various shell scripts. I do a waitFor () for the
> process to terminate, check the InputStream and ErrorStream. The streams are
> empty...
>
> Any hints?
>
> TIA
>
> Marius
>
> Marius Schamschula, optical physicist, mac, and network coordinator
>
> The Center for Applied Optical Sciences: http://www.caos.aamu.edu/
> Department of Physics, Alabama A & M University
--
M a r k H o f m a n n
Department of Computer Science
University of Stellenbosch / South Africa
phone: +27-82-7449880