PDA

View Full Version : Geek Question



SoonerInKCMO
12/6/2006, 03:43 PM
So I'm running this Perl script with the '-w' switch turned on and I want to capture the diagnostics output in a file rather than having it display on the screen.

What I've tried is the following:
./perl /directory/program.pl > /directory2/output.log

This will create a file named 'output.log' but there is nothing in it - and the diagnostic messages still appear on the screen.

Any ideas? :confused:

slickdawg
12/6/2006, 03:51 PM
what shell are you using? csh, sh, bash, etc?

slickdawg
12/6/2006, 03:55 PM
if in bash/sh try this

perl program.pl 2> /tmp/outputfile

that will send all of your logging to the file /tmp/outputfile

SoonerInKCMO
12/6/2006, 03:59 PM
I'm using bash... yeah, I figured out what I was doing wrong right before I read your post. You're right - using the 2> for STDERR is what I wanted.

Thanks!