Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

Have Programming Question? Ask it here!
 
 
 


naveen yadav
how to execute a unix shell script from a java program
1 Answer(s)      2 years and 10 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..


Advertisement
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 Tutorials/Questions & Answers:
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
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
Advertisements
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 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
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
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
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
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
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&
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
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
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
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
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
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
How to create a .mdf file from script (.sql)
How to create a .mdf file from script (.sql)  Hi, I have a sql database in 2008 server. now i want it to convert to 2005. so i script it. just help me to create a .mdf file back from the script
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
unix
unix  not able to download java into unix os
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, how to dynamically increase size of list box in javascript when elements retrieving from database.. That is whenever I
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
how to execute a file in java at regular time intrevals automattically
how to execute a file in java at regular time intrevals automattically  how to execute a file in java at time retrievals automatically
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
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
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
how to write to java program to get the particular data from the website
how to write to java program to get the particular data from the website   i have to get the particular data by selecting the just numbers.. from the site .. how to get the ful details from the website by clicking the number
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
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
How to execute shellscript in Javascript
How to execute shellscript in Javascript   Hello Can anyone please explain me how to execute shellscript in Javascript Thanks
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
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
Java code to run unix command - Java Beginners
Java code to run unix command  Hi, I need a java code to connect to a remote unix server and run a unix command. Please help. Regards, Pratyush
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
can i Execute PHP code inside python script?
can i Execute PHP code inside python script?    can i Execute PHP code inside python script
how to call java script function through java class file
how to call java script function through java class file  how to call jframe in java script
how to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program
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
How to open a window from a java program (from code)[ (onclick of something text )]
How to open a window from a java program (from code)[ (onclick of something text )]  When I download the code an put it in Eclipse, the applet is run, but on click of the button displayed in the applet, a new window with google
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 to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program... to create a java project in Eclipse and how can you add additional capabilities
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
Execute .dll file in java?
Execute .dll file in java?  please anybody give me solution for executing .dll files in java
Unix and Perl Programmer
PERL and TCL TK  Unix/Shell/ scripts with Oracle... Unix and Perl Programmer       Position Vacant: Unix and Perl Programmer  Job
Java Script
Java Script  Hello Sir, Is it possible to select only current date from datetimepicker in struts2 through java script validation. Means when i select.... Try to send me java script validation code for this purpose that user won't
Advertisements
 

 

 

DMCA.com