Reputation: 6189
I am trying to translate the following cshell command to bash but I am not sure what it does and how I can translate it to bash.
./runall |& fold -w 80 |& tee ${log_file}
Any help appreciated,
Ted
Upvotes: 0
Views: 329
Reputation: 263237
foo |& bar
executes foo
with its stdout and stderr piped to the stdin of bar
.
The bash equivalent is foo 2>&1 | bar
.
So for your command, it should be (untested):
./runall 2>&1 | fold -w 80 2>&1 | tee ${log_file}
(The curly braces in ${log_file}
aren't really necessary, but they're harmless, and some consider them to be a good idea; that's true for both csh and bash.)
Upvotes: 1