Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion on running a generic shell command #54

Open
ORESoftware opened this issue Oct 30, 2017 · 0 comments
Open

suggestion on running a generic shell command #54

ORESoftware opened this issue Oct 30, 2017 · 0 comments

Comments

@ORESoftware
Copy link

ORESoftware commented Oct 30, 2017

To run a generic shell command, do this:

const cp = require('child_process');

const k = cp.spawn('bash');
k.stdin.write('\n');
k.stdin.write('any command you would ever want in any format');
k.stdin.end();

the above will change your life when writing library code where the user gives you an arbitrary command to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant