This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Redirecting compiler output
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Dr. Germund Höjer" <germund at eros dot pquim dot unam dot mx>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 30 Jan 2004 12:44:08 -0500
- Subject: Re: Redirecting compiler output
- References: <opr2lngwbyvlabao@mail.eros.pquim.unam.mx>
"Dr. Germund Höjer" <germund@eros.pquim.unam.mx> writes:
> I cannot get g77 and gcc to redirect compiler messages to a text file.
> The line
>
> g77 code.f > report.txt
>
> only creates a file report.txt of zero lenght and any error or warning
> messages from the compiler only scroll by on the screen. I get the
> same behaviour working in KDE graphic mode and in plain text mode
> (SuSE Linux 8.1) with various versions of gcc. I am using 3.3.2 now.
> And the same happens with gcc 3.2.2 running under MinGW/Windows98 so I
> doubt it is an OS problem.
This is a basic Unix question. It is not a compiler question.
If you are using bash, you want
g77 code.f 2> report.txt
or
g77 code.f &> report.txt
Ian