Re: Redirecting compiler output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dr. Hojer,

It's not in the GCC manuals, because it's not a GCC issue.  It's an issue of your shell and your operating system.

Assuming you are using a bash shell (or one similar enough), do one of these:

g77 code.f >report.txt 2>&1
g77 code.f >report.txt 2&>1

That ties the stderr to the stdout destination.  (Note, because of buffering, sometimes the different outputs will be combined with funny interleaving.)  Warning:  it's IMPORTANT to tie the two together AFTER having redirected the stdout.  Order matters.

Alternatively, you can capture the stdout and stderr outputs to separate files:

g77 code.f >code.out 2>code.err

If you are using MS-DOS or MS-Windows' CMD shell, I'm not sure of the syntax.  If you are using a Microsoft OS, I recommend Cygwin <www.cygwin.com> for your shell needs.

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux