Results 1 to 3 of 3
Thread: Linux Shell
- 01-30-2010, 01:23 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 70
- Rep Power
- 0
Linux Shell
I don't really know where this fits, so posting here. :)
How do i execute a command one would normally execute from the terminal? I did some googling, but i can't get it to work (nothing happens).
What i want execute:
which you can execute directly from the terminal.Java Code:"streamer -t 01:00:00 -j 100 -o pic.jpeg"
On a seperate note, how do you find out the host operating system?
- 01-30-2010, 01:40 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,540
- Rep Power
- 11
ProcessBuilder. What have you tried and what happened when you tried that?
OS name, architecture and version can be obtained with System.getProperties().
- 01-30-2010, 04:51 AM #3
Member
- Join Date
- Mar 2009
- Posts
- 70
- Rep Power
- 0
Thanks,
I've made some progress, and have gotten a command to execute. The line is:
Now, my problem is this:Java Code:p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c","streamer -r 30 -j 100 -t 01:00:00 -o "+workDir+"000000.jpeg"});
When the user exits the program, i must be able to stop the streamer process. p.destroy() simple quits the interpreter, sh. However, streamer continues to run. How do i end that process?
Similar Threads
-
How to create my own linux shell in java?
By wahib.tech in forum Advanced JavaReplies: 1Last Post: 10-16-2009, 08:44 AM -
[SOLVED] Windows Linux conflict - TrayIcon image not display in Linux
By Eranga in forum Advanced JavaReplies: 6Last Post: 04-08-2009, 04:05 AM -
Bean Shell
By Bisweswar in forum Advanced JavaReplies: 2Last Post: 08-16-2008, 12:36 AM -
Shell Sort in Java
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks