1

We were working on a project and wanted to call a shell script from JavaScript. We tried to look for help online but were unable to find any good example for the same. Can someone point is in the right direction ? We tried child_process.exec, but we were unable to get anything out of it.

4
  • Shell script on the clients computer or are you talking about node.js or sth? Commented Jun 26, 2013 at 6:52
  • Shell scripts on the clients computer Commented Jun 26, 2013 at 7:25
  • What JavaScript environment? A browser? Something else? Commented Jun 26, 2013 at 8:05
  • The poster is obviously talking about node.js: nodejs.org/api/child_process.html Commented Jun 26, 2013 at 9:39

2 Answers 2

1

No. It would be such a gigantic security hole that any browser developer who allowed this would be [family-friendly censorship banner].

The right answer to this is Why do you want to do that?

Sign up to request clarification or add additional context in comments.

Comments

0

As pointed out by l0b0, this isn't possible directly. You would need to set up some kind of web service on the server that the JavaScript can call. This service would then in turn call the shell script. But be careful.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.