0

So I have some javascript code that will execute a shell scipt:

    var exec = Meteor.npmRequire('child_process').exec;
    exec("/Users/ray/Desktop/scripts/hello.sh");

This shell scipt will execute a python file. I was wondering how could I pass this shell script some arguments for the python script from my javascript code?

2
  • exec("python /home/user/script.py foo bar"); Commented Sep 1, 2015 at 18:31
  • @taesu will this work for node.js 0.12.x? Commented Sep 25, 2015 at 1:44

1 Answer 1

1

I believe if you were to add your arguments as such:

exec("/Users/ray/Desktop/scripts/hello.sh arg1 arg2 arg3");

It should work.

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

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.