On 11/13/2013 03:41 AM, Pierre Labastie wrote:
> Le 13/11/2013 02:53, Ken Moffat a écrit :
>> On Tue, Nov 12, 2013 at 07:57:30PM -0500, Baho Utot wrote:
>>> If you are using bash 4.0 or greater
>>>
>>> ../path/to/binutils-source/./configure ... | tee myconflog 2>&1
>>>
>>> becomes
>>>
>>> ../path/to/binutils-source/./configure ... |& tee myconflog
>>>
>>    I would change 'becomes' to 'can be changed to' - there is no
>> *requirement* to change a following '2>&1' to a preceding '&'.
>>
>>
> but 2>&1 should be before the `|' anyway : it does not work the same as `>'.
>
> If you type the command as above, it sends the "tee" errors to stdout,
> not the "configure" errors...
>
> Regards
> Pierre
>
configure |& tee myconf.log - sends both stdout and stderr to the log

cat myconf.log
Checking for gcc...
Checking for shared library support...
Building shared library libz.so.1.2.8 with gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using 
vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.


./configure --pretix |& tee myconf.log
cat myconf.log
unknown option: --pretix
./configure --help for help
** ./configure aborting.

That is why I use |& as I don't need to make sure the 2>&1 is in the 
right place...It just works


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to