Home Answers Viewqa RMI how to execute a unix shell script from a java program

 
 


naveen yadav
how to execute a unix shell script from a java program
1 Answer(s)      a year and 6 months ago
Posted in : RMI

well , i am facing this problem.. i have tried a few sample codes but there isn't any solution . could anyone please give a sample code as of how to do this...

what i am trying is that there we can enter a username,server name and a password alongwith the script name from a java code .once you execute this java program ultimately your script gets executed.. it would be a lot of help to me..

View Answers

November 11, 2011 at 1:43 AM


Well its easy man,

You should be on a linux box for doing this.

Java has a Runtime class using which you can execute commands.

But in your case, what can be done is:

Process processObj = Runtime.getRuntime().exec("sh yourScriptName.sh");

Hope it helps.

Reno Jones









Related Pages:
how to execute a unix shell script from a java program
how to execute a unix shell script from a java program  well , i am... the script name from a java code .once you execute this java program... solution . could anyone please give a sample code as of how to do this... what i am
unix
unix  Write a program lc[1] which takes a file name as its sole argument and prints out how many lines the file contains. An example execution of this program might look as follows: $ java lc lc.java 20
unix program - UML
unix program  sorry there is no unix category i slected uml 1.write a c shell script on links? 2.write a c shell that stimulates the fork? 3.write a c shell that stimulates the umask? 4.write a c shell that stimulates
UNIX - Java Beginners
pipes, shell scipts etc. Disadvantages of Unix: 1) The traditional command...UNIX  Dear Sir, Kindly send some important points/notes in UNIX since I have taken the exam pertains to UNIX, so that it will be very helpful
windows shell scripting
= Hello, Param2 = C:\Program Files\Java, Param3 = abcd.txt C:\Program Files\Java>...windows shell scripting   Hi All, Using this knowledge make a batch...?? and Param2 = â??C:\Program Files\Javaâ??, then when the batch file is executed
windows shell scripting
= Hello, Param2 = C:\Program Files\Java, Param3 = abcd.txt C:\Program Files\Java>...windows shell scripting   Hi All, Using this knowledge make a batch...?? and Param2 = â??C:\Program Files\Javaâ??, then when the batch file is executed
LINUX SHELL SCRIPT - Date Calendar
LINUX SHELL SCRIPT   I wish to create a bash shell script that meets the requirements below. ?Write a bash shell script called how_many_to_go... not make any assumptions about what month it is - the script should run properly
unix
of which is a number, and add them together. Incorporate sum into a program which sums its command line arguments: $ java Sum 2 4 11 4 21
Export to Shell Script Plugin
Export to Shell Script Plugin   ... having to custom write the shell script code For more information click... of an eclipse project's runtime configurations to shell scripts in various formats
execute a PHP script using command line
execute a PHP script using command line  How can I execute a PHP... Line Interface) program and provide the PHP script file name as the command line... the CLI program. Be aware that if your PHP script was written for the Web CGI
Linux and Unix Books page1
a fairly powerful programming language. A shell program, called a script... a Linux or UNIX shell account. We are going to connect via our windows... their capabilities to Unix, Linux, Java, and Mac platforms.    
Linux and Unix Books page1
a fairly powerful programming language. A shell program, called a script... a Linux or UNIX shell account. We are going to connect via our windows... their capabilities to Unix, Linux, Java, and Mac platforms.    
Linux and Unix Books page3
the kernel, through system calls, to execute the program rm on myfile. ... of the ideas from current research, while trying to maintain the UNIX philosophy... Linux and Unix Books page3     
Linux and Unix Books page4
Linux and Unix Books page4     ...; In this paper we address the problem of how an operating-system kernel or a server can determine with absolute certainty that it is safe to execute code supplied
Linux and Unix Books page3
the kernel, through system calls, to execute the program rm on myfile. ... of the ideas from current research, while trying to maintain the UNIX philosophy... Linux and Unix Books page3     
Java Script Program
Java Script Program  <%-- Document : index Created... () that prevented it from fulfilling this request. exception... are available in the Sun Java System Application Server 9.1 logs. Sun Java System
Java Script Program
Java Script Program  <%-- Document : index Created... () that prevented it from fulfilling this request. exception... are available in the Sun Java System Application Server 9.1 logs. Sun Java System
Linux and Unix Books
Linux and Unix Books       Page-1 UNIX is a very stable and very powerful operating system. This tutorial assumes you have access to either a Linux or UNIX shell
JBoss Unix and Line Separator
from the PrintWriter class from java api, this method uses the default line separator from O.S. \n on unix, but I am trying to change to \r\n. I change the run.conf script from jboss I added the parameter -Dline.separator=separator I
unix
unix  not able to download java into unix os
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
Merging of java script with servlet program
Merging of java script with servlet program  how can we merge the java script with the any servlet program for making web application intractive.Is there any program you have.\please help me to sove out this problem
Linux and Unix Books
Linux and Unix Books       Page-1 UNIX is a very stable and very powerful operating system. This tutorial assumes you have access to either a Linux or UNIX shell
Java Script
Java Script  What is Java Script? How to learn Java Script?   Hi Java Script is client side programming language. It runs on browser.... You can learn Java Script from our JavaScript - JavaScript Tutorial pages
unix
unix  hai friends, I am new to to java with unix.can you any one tell me ho to work unix in windows xp.i search in net,it will show the aludra.usc.edu.how can i install this? thanks
java script - JSP-Servlet
java script add items  How to add items in an array in JavaScript... Transitional//EN"><html><head><title>tree program in javascript</title><script type="text/javascript" src="mtmcode.js
How can I execute a PHP script using command line?
How can I execute a PHP script using command line?  How can I execute a PHP script using command line
Linux and Unix Books page4
Linux and Unix Books page4     ...; In this paper we address the problem of how an operating-system kernel or a server can determine with absolute certainty that it is safe to execute code supplied
Error Handling in Java Script
will Learn how to handle error in java script. JavaScript is scripting language used... Error Handling in Java Script  ... should be written in lowercase if we write in upper case  program
Writing Simple Java Script Program
JavaScript Program In the last lesson you learned how to create simple java script... Writing Simple Java Script Program   ...;Run Java Script First Program". The will display the message box. Here
How can java programs execute automatically when it connects to network
How can java programs execute automatically when it connects to network  Good Day dears... How can java programs execute automatically when... internet Connection through my java program
Connecting to Unix through Java - JavaMail
Connecting to Unix through Java  Could you please tell a sample code, where i connect to the unix server and run a script and write the results in a file and mail that file back to me
Java Vs Script
Java Vs Script       The Java  and Java Script are completely different from each other... Java  and Script language in more detail Java Java is completely object-oriented
Execute the java program using one processor
Execute the java program using one processor   Write a program to print the number series 1, 2,3, 4ââ?¬Â¦.100 using java programming language in dual core computer a) Execute the program using one processor b) Execute
Execute SQL Queries with Java Application
Execute SQL Queries with Java Application       This is detailed java program to connect java... values and retrieve values from the table. Before running this java code you
How I get a variable from java script to use it in the scriptlet of jsp.
How I get a variable from java script to use it in the scriptlet of jsp.  Hi i want to get the tinyUrl value in the scriptlet of jsp. // Bit.ly API var url="http://cplive.com/dealDetail.do?method=displayDealDetail&
Example program to pass value from Html to java script
Example program to pass value from Html to java script... html code to java script easily. To show this we have created an example Html page which will pass the value to the java script function and this value
How to read PDF files created from Java thru VB Script
How to read PDF files created from Java thru VB Script  We have created the PDF file thru APache FOP but when we are unable to read the data thru... file?   Java PDF Tutorials
Java script
Java script  a java script code for accept 10 numbers from the user and print in the descending order without using sort method
java script
java script  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
Java Script - JSP-Servlet
Java Script  hi, im having a problem in updating the cart. below is the code for that. what i want is i need to enter the how much quantity..."); stmt=con.createStatement(); rst=stmt.executeQuery("select * from
Program compiles but won't execute - Java Beginners
Program compiles but won't execute  I have to write a program... so far for the Employee class(it compiles but does not execute); public class... written which again compiles but does not execute; public class Driver
JDBC Execute Statement
a database. In this Tutorial, the code illustrates an example from JDBC Execute... JDBC Execute Statement       JDBC Execute Statement is used to execute SQL Statement, The Execute
JDBC Execute Update Example
a simple example from JDBC Execute update Example. In this Tutorial we want... JDBC Execute Update Example       JDBC Execute Update query is used to modify or return you an integer value specify
java script
java script  how will you identify whether the number entered by the user has two digits or three digits.Assuming that the user enters only a three digit or two digit number.   <HTML> <HEAD> <SCRIPT
java script
java script  when you click a button how will you change the background color of a web page
Understanding Various MySQL Executable Files
;    This lesson you learn  how to the execute...;. It is possible put the SQL statement in file and tell the mysql from input... the this command for file execute. It is use this command in MySql execute file
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  hi all, how can i insert elements into java script list box retrieving from Database. whenever I insert any element in the Db
Unix Web Hosting
Unix Web Hosting Unix Web Hosting is the type hosting provided on the Unix Servers. Unix Web Hosting is very reliable hosting option. Unix Hosting.... UNIX web hosting and Linux web hosting are the most powerful and reliable hosting
How to run PHP Script from the command line ?
How to run PHP Script from the command line ?  Running PHP Script from the command line   Actually it is very simple to run php script... expect. You can also check : http://www.phpzag.com/running-php-script-from

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.