Capturing output of shell script in Automator
I have an Automator work flow that includes the execution of a shell script. The script in turn executes a Perl script and captures its output on a file. This may sound a bit convoluted, but the Automator part was intended to automate disparate scripts that were already made, so I just "glued" them together.
The shell script is like this:
cd "/Users/username/Documents/Development/"
./script.pl "$1" 2>&1 >out.logThe problem is that, after execution, "out.log" contains the output from STDOUT, but not STDERR. I know because if I run "script.pl" from the Terminal, I get not only the normal output, but a couple of errors or warnings spit out by the script.
I was under the impression that "2>&1>out.log" would redirect STDERR to the filehandle used by STDOUT, and then redirect STDOUT to the file, with the ultimate result of redirecting both filehandles to the output file.
Is there something I'm missing? How can I capture the STDERR from the script as well? Keep in mind that the shell script is executed from an Automator work flow.
Thanks!
-dZ.
Mac Pro (Early 2009), Mac OS X (10.7.4), 2.26 GHz (Quad-Core) x2 - 6GB RAM