We know `exec(...).output.to(file)` works, but... why to be so verbose? `node -e "require('shelljs/global'); exec('git status').to('/tmp/file')"` should work.