Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Redirecting STDERR output to file in the cpan shell

by lancer (Beadle)
on Dec 02, 2010 at 12:51 UTC ( #874881=note: print w/ replies, xml ) Need Help??


in reply to Re: Redirecting STDERR output to file in the cpan shell
in thread Redirecting STDERR output to file in the cpan shell

Thank you cdarke, this is even closer to what I originally intended to do.

I didn't know the "cpan" tool could be invoked by itself from the command line. It does work however, and from there it's possible to redirect STDERR and STDOUT to a file with the cmd shell, exactly as you specified in your example.

Now I got the output into a file, and it's over 30Kb's long.

Piping into the "more" utility also works, but it's a lot less useful than "less" on Linux. But still, it's good to know that this technique exists.

Have a nice day! :)


Comment on Re^2: Redirecting STDERR output to file in the cpan shell
Re^3: Redirecting STDERR output to file in the cpan shell
by raybies (Chaplain) on Dec 02, 2010 at 13:53 UTC
    It sometimes helps to pipe to "tee" (see linux command, man tee) the output so that it still appears on your console, but you can capture it. This way if there's any interractive input required by the script you can see the prompts. The 2>&1 directive tells the shell to send STDERR to the same place as STDOUT, that's for the bash shell. For C shell the equivalent redirective would be  >& or for pipe |& .
Re^3: Redirecting STDERR output to file in the cpan shell
by cdarke (Prior) on Dec 04, 2010 at 14:04 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://874881]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-09-21 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls