Valhalla Legends Archive

Programming => General Programming => Java Programming => Topic started by: hismajesty on August 24, 2004, 09:27 PM

Title: Issuing console commands
Post by: hismajesty on August 24, 2004, 09:27 PM
How would I go about issuing commands to a console, such as ping google.com? I know the Windows APIs allow Shell(), but I'm looking more towards using this particular thing on a Linux machine. Thanks.
Title: Re:Issuing console commands
Post by: Orillion on August 24, 2004, 10:51 PM
Look at using Runtime.exec(). It returns a Process object that allows you to access all the various streams for the command yourve executed.
Title: Re:Issuing console commands
Post by: hismajesty on August 24, 2004, 11:29 PM
Alright.

Also, I don't really need to know anymore. I wanted to add a .update command to JavaOp so I could update the bot running in our channel when I make changes and iago is afk. But he gave me permission to access the script through my shell, so I can use that. :)
Title: Re:Issuing console commands
Post by: iago on August 26, 2004, 01:05 AM
And I'm having issues with the script.  Pretty soon I'm just going to make a javaop account and give everybody the password >:(