Is it possible to combine output from these two commands?
node ~/projects/trunk/index.js
python ~/projects/trunk/run.py run
Neither command exits so I'm not sure how to do this.
Is it possible to combine output from these two commands?
Neither command exits so I'm not sure how to do this. |
|||||||||
|
You can combine two commands by grouping it with
so far, you can redirect the group to a file :
if you want to separate
|
|||||||||||||||||||||
|
More generally, it's possible to use either a subshell or command grouping, and redirect the output of the whole group at once. Code:
The main difference between the two is that the first one splits of a child process, while the second one operates in the context of the main shell. This can have consequences regarding the setting and use of variables and other environment settings, as well as performance. Don't forget that the closing bracket in command grouping (and functions) must be separated from the contents by either a semicolon or a newline. This is because |
|||||||||
|
I ended up doing this, the other suggestions did not work, as the 2nd command was either killed or never executed.
|
|||||||||||||
|
Try this:
|
|||||||||||||||||||||
|