0

I am designing a javascript utility which needs to grep a password file ('ypcat passwd | grep ') in Unix. PERL uses "backtick" or System to run the command line. Python uses os.system. Is there a similar method in javascript?

2
  • explore child_process in nodejs, you can use something like : let {exec} = require("child_process"); exec("cmd") Commented May 10, 2021 at 20:26
  • Did you mean in node.js? (if so, add the tag) Commented May 10, 2021 at 20:41

2 Answers 2

0

Yes sir there is https://nodejs.org/docs/latest/api/child_process.html It's child_process.exec()

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

Comments

0

I don't believe there is a similar method within native JavaScript, but you may be able to achieve this using NodeJS.

Check this out, https://nodejs.org/api/os.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.