Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thank you, this works. An additional question; if i replace echo with node, which was my initial goal, calling a node-script. I get command not found: node despite node being inside my $PATH variable. Which I checked by echoing path from inside the script. Thoughts? Commented Mar 23, 2019 at 14:47
  • Without seeing the command you're attempting to execute and your path I can't really speculate. Commented Mar 23, 2019 at 15:02
  • node script.js succeeds, output=$(node script.js) fails. Falls perfectly in line with the question title, actually. Commented Mar 23, 2019 at 15:14