By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

how to run a shell script using javascript

P: 34
Hi,
I have a button. I want to run a shell script when i click that button.
My HTML code is given below:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <input type = "button" value = "run script" onclick = "some javascript func to run script()">
  6. </body>
  7. </html>
  8.  
Can anybody help me out for this problem?
Oct 28 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
This won't be possible with standard JavaScript on a normal web page. What are you trying to do?
Oct 28 '08 #2

P: 34
This won't be possible with standard JavaScript on a normal web page. What are you trying to do?
Thanks for ur reply.
I have two buttons one is for start server and other for stop server.
To start a server one shell script is there and for stop also.
I want to do that when i click start button it should start my server for that i have to run that shell script.
Using java api Runtime and Process i can run shell script but by clicking a button how to run shell script i do not know.
Can you help me out?????
Oct 29 '08 #3

acoder
Expert Mod 15k+
P: 16,027
If it's a shell script on the server, then use Ajax to call the server-side script. That's if you want to avoid a page unload. If not, you could just submit the page. If you're not familiar with Ajax, check out some of the links in the Off-site Links sticky.
Oct 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.