473,769 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Executing unix commands from java application

I seem to remember there's a java function for executing commands on the
native system (UNIX in this case) but cannot remember which. Anyone know?

Also, is it possible to grab the results of the command back into the java
app?

Example:

1. Execute the 'ls -l' command on the unix machine
2. Grab the reults back into a variable
Jul 17 '05 #1
2 6898
> 1. Execute the 'ls -l' command on the unix machine
Runtime#exec()
2. Grab the reults back into a variable

Process#getInpu tStream()
Jul 17 '05 #2
Aaaah! Thats it!

Thanks!

Simon
"hiwa" <HG******@nifty .ne.jp> skrev i meddelandet
news:68******** *************** ***@posting.goo gle.com...
1. Execute the 'ls -l' command on the unix machine

Runtime#exec()
2. Grab the reults back into a variable

Process#getInpu tStream()

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2545
by: Jonathan Li | last post by:
I have posted the question before but nobody have given me a solution. I would like to rephrase my requirement and want to hear your advice. We are developing application packages for logistics industry. The plan is to develop two packages, one for daily operation in Client/Server mode. The other is for reporting/enquiry in Browser/Server mode. 1. The server must be Unix When I say 'server' means 1) database server; 2) if possible also...
2
3004
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate Python scripts, where each one executes in it own thread of control. I would like to use a Unix command to get each script to run in its own shell. I have tried using the "Commands" module but after I issue the first "command", execution blocks...
4
6323
by: Alex Martinoff | last post by:
Using the org.postgresql.Driver JDBC driver is it possible to connect to Postgres using a unix domain socket instead of a TCP socket (so you don't have to start the postmaster with -i)? Using a TCP socket instead of a unix socket seems to slow down requests that return large result sets by a factor of 3 on the same machine. What's the point of all the extra CPU overhead if you're on the same machine? A high-volume server can really do...
3
5738
by: Fabian Knopf | last post by:
Hi friends, i have a unix machine PC1 where a database is running ( IBM DB2 V8.1 ) . Then i have another machine PC2 i installed there also ( IBM DB2 V8.1 ). On PC2 i installed unixODBC. To connect to the database over ODBC on unix i did this: on db2 console: catalog tcpip node archiv remote PC1 server DB2_db2inst1
4
8770
by: Justine | last post by:
Hi All, How can v execute DOS command while executing Console Application written using C#, like cls,dir commnads. Thanz in Advance, Justine
0
1470
by: Bruceneedshelp | last post by:
My application starts logging and executes shell commands on startup. The application runs fine, except when it executes at boot time. In other words when I make it a "startup" application on my Windows XP box, it does everything except logging and shell commands. If I execute the application after Windows XP boots up, then it runs just fine. It seems as if the app is not getting its inherited functionality at boot time. Any help is...
1
1476
by: natsran | last post by:
Hi All, Is there any perl module which would help in executing commands remotely on a windows machine? For doing the same on unix machine, I found that we could use Net::Telnet module. But again one limitation of Net::Telnet module is that it fails to communicate with linux machines. Thanks in Advance, Natasha
1
2385
by: patrickdub | last post by:
Hi, I'm wondering what kind of things do I need to look out for when converting my .cmg scripts to Unix scripts. (I want the same inputs and outputs, but I'm now running on a Unix Server. I know that the scripts are basically similar, and that a lot of the commands will probably remain the same, but I'm too unfamiliar with shell commands to know exactly. Are there any useful links available on this topic, or some sound advice...... or...
1
1816
by: Marcin Wiszowaty | last post by:
Hello, I work at a company that has 2 development enviroments. One Unix which i dont know anything about and the othe vs.net 03 with MSSQL server 2000 for db. How can i cause applications (scripts) to get run in unix while using preferably vb.net or c# applications run in windows. So far all the unix aplications are started manualy through the command window. Files are sent using FTP. We have XceedFTP client to send files to unix from...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.