Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux General Discussion (http://www.linux-archive.org/archlinux-general-discussion/)
-   -   How to do this (http://www.linux-archive.org/archlinux-general-discussion/443686-how-do.html)

Christian 10-24-2010 02:33 PM

How to do this
 
Hi all,
I know that I have to use piping for this, but I want to output the
errors I get while compiling a program into atext file.

What to type after make then?
Many thanks for any help,
Christian

jesse jaara 10-24-2010 02:36 PM

How to do this
 
If you build it in some terminal emulator you might be ableto save the whole
output into file. If i remember right atleast kdes konsole and yakuake can
do that
On 24.10.2010 17.33, "Christian" <christian08@runbox.com> wrote:
> Hi all,
> I know that I have to use piping for this, but I want to output the
> errors I get while compiling a program into atext file.
> What to type after make then?
> Many thanks for any help,
> Christian

Lukas Fleischer 10-24-2010 02:36 PM

How to do this
 
On Sun, Oct 24, 2010 at 04:33:10PM +0200, Christian wrote:
> I know that I have to use piping for this, but I want to output the
> errors I get while compiling a program into atext file.
> What to type after make then?

`make 2> foobar` will put them errors in a text file called "foobar".

jesse jaara 10-24-2010 02:38 PM

How to do this
 
I think i miss understoid you, if you wang the output og make to file you
can put >/file/path to end if iy
On 24.10.2010 17.36, "jesse jaara" <jesse.jaara@gmail.com> wrote:
> If you build it in some terminal emulator you might be ableto save the
whole
> output into file. If i remember right atleast kdes konsole and yakuake can
> do that
> On 24.10.2010 17.33, "Christian" <christian08@runbox.com> wrote:
>> Hi all,
>> I know that I have to use piping for this, but I want to output the
>> errors I get while compiling a program into atext file.
>> What to type after make then?
>> Many thanks for any help,
>> Christian

Lukas Fleischer 10-24-2010 02:45 PM

How to do this
 
On Sun, Oct 24, 2010 at 05:38:35PM +0300, jesse jaara wrote:
> I think i miss understoid you, if you wang the output og make to file you
> can put >/file/path to end if iy

">" won't work since errors are printed to stderr (not stdout) in most
cases. "2>" should do the trick. If there are some errors printed to
stdout, you could use `make 2>&1 >foo`.

Christian 10-24-2010 02:55 PM

How to do this
 
Hi,
On 2010-10-24 16:45, Lukas Fleischer wrote:

On Sun, Oct 24, 2010 at 05:38:35PM +0300, jesse jaara wrote:

I think i miss understoid you, if you wang the output og make to file you
can put>/file/path to end if iy

">" won't work since errors are printed to stderr (not stdout) in most
cases. "2>" should do the trick. If there are some errors printed to
stdout, you could use `make 2>&1>foo`.
Yes, that helped. Many thanks!

Johannes Held 10-24-2010 03:20 PM

How to do this
 
Christian <christian08@runbox.com>:
> I know that I have to use piping for this, but I want to output the
> errors I get while compiling a program into atext file.
> What to type after make then?
You could try "tee". man tee.

your_command | tee file_1 file_2


--
Gruß, Johannes
http://hehejo.de

Heiko Baums 10-24-2010 03:24 PM

How to do this
 
Am Sun, 24 Oct 2010 16:33:10 +0200
schrieb Christian <christian08@runbox.com>:

> Hi all,
> I know that I have to use piping for this, but I want to output the
> errors I get while compiling a program into atext file.
> What to type after make then?
> Many thanks for any help,
> Christian

The easiest way in Arch Linux is building a PKGBUILD, and putting it
to /var/abs/local/<packagename>.

Then cd to this directory and run `makepkg -L`.

Otherwise run `make > /path/to/logfile 2> /path/to/logfile`. You
probably need to replace > by >> and 2> by 2>>.

Heiko

Baho Utot 10-24-2010 03:34 PM

How to do this
 
On 10/24/10 11:20, Johannes Held wrote:

Christian<christian08@runbox.com>:

I know that I have to use piping for this, but I want to output the
errors I get while compiling a program into atext file.
What to type after make then?

You could try "tee". man tee.

your_command | tee file_1 file_2




If you need to bail from a calling makefile/bash script if an error
occurs do this:


LOG=<your_log_file>

( <your_command> | tee -a ${LOG} && exit $PIPESTATUS ) # append to a log
file


( <your_command> | tee ${LOG} && exit $PIPESTATUS ) # overwrite the log file

Then the calling makefile/bash script will bail on an error and not
continue.

Matthew Monaco 10-24-2010 05:16 PM

How to do this
 
On 10/24/2010 10:45 AM, Lukas Fleischer wrote:

On Sun, Oct 24, 2010 at 05:38:35PM +0300, jesse jaara wrote:

I think i miss understoid you, if you wang the output og make to file you
can put>/file/path to end if iy


">" won't work since errors are printed to stderr (not stdout) in most
cases. "2>" should do the trick. If there are some errors printed to
stdout, you could use `make 2>&1>foo`.



Or just "&> foo"


All times are GMT. The time now is 05:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.