I have this:

npm install "$tgz_path"  &>> "$HOME/.r2g/logs/r2g.log";

but that is syntactically incorrect. How do I append stdout+stderr to that log file?

1 Answer 1


That syntax is valid in bash. From man bash:

The format for appending standard output and standard error is:


A more basic way to write it (that works in more shells) will be:

$ npm install "$tgz_path" >>word 2>&1 "$HOME/.r2g/logs/r2g.log";
  • yeah maybe bash3 can't do the first one, I get a syntax error with bash3 May 8, 2018 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .