Under Linux/bash I want to run a command and send standard output to foo.txt as well as combined standard output and standard error to bar.txt:
$ cmd < input.txt 1>foo.txt 1+2>bar.txt ???
What's the easiest way to do this?
To send just stdout is:
$ cmd > foo.txt
To send both stdout/stderr is:
$ cmd &> bar.txt
However trying to combine:
$ cmd > foo.txt &>bar.txt
Causes foo.txt to be empty.