node.js - Equivalent of <() for sh? -
i have script runs in zsh.
cat foo.txt <(node bar.js) > out.txt
this little script configured in node.js module uses /bin/sh
execution. problem sh fails @ <
/bin/sh: -c: line 0: syntax error near unexpected token `('
the goal concatenate contents of foo.txt , output of executed script single out.txt
can somehow achieve same thing using sh?
you can achieve same effect original script grouping commands within {...}
this:
{ cat foo.txt; node bar.js; } > out.txt
using <(...)
can cat
awkward , inefficient. using grouping better , more portable, think it's improvement on original script.
Comments
Post a Comment