"ls > foo.log 2>&1"
If you search for output redirecting, all articles online would tell you this is correct. However my shell kept complaining "Ambiguous output redirect."
This is a csh/tcsh error message for which the correct redirection is supposed to be
"ls >& foo.log"
So, apparently I was using a csh/tcsh, rather than BASH shell. The former was in BASH syntax.
To find out what shell you are using, type
"ps -p $$" on whatever shell you are working on, it will tell you.
No comments:
Post a Comment