running shell commands from within code
"Simon Cross" <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <000101c3faf7$6428fde0$2501a8c0@simon> |
Hi all,
I need someone with a bit more experience of java than me to give me a
few pointers on this one..
I've got a program called spistartup.tini. What I need to do is have a
line in this program which executes a command on the slush command line
to run another program. The command to run is...
>java spiout.tini 27
... where spiout.tini is the program and 27 is the runtime argument.
I've seen a method called 'execute()' in com.dalsemi.system.TINIOS but
as a kind of java virgin, the following doesn't really make sense to
me...
execute
public static void execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.Hashtable env)
throws java.lang.ExceptionExecutes a command in the
shell.
Parameters:
commandLine - An Object array containing the command in the first
element, followed by any parameters need for that command in a String[]
in the second element.
in - The stream the command will use to get input.
out - The stream used to report non-critical messages.
err - The stream used to report critical messages.
env - A table of environment variables.
Throws:
java.lang.Exception - Any exception raised by the command.
How do I actually write this into my spistartup.tini program???
Any help would be appreciated.
Regards,
Simon Cross, University of Nottingham, UK
www.simoncross.com
[email protected]
+44 (0) 77967 444 304
_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini