help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] exec > >(tee -a foo.log) alternative?


From: Roger
Subject: Re: [Help-bash] exec > >(tee -a foo.log) alternative?
Date: Sun, 22 Dec 2013 09:35:04 -0900
User-agent: Mutt/1.5.21 (2010-09-15)

> On Sun, Dec 22, 2013 at 10:15:49AM +0200, Pierre Gaston wrote:
>On Sun, Dec 22, 2013 at 12:04 AM, adrelanos <address@hidden> wrote:
>
>> Hi!
>>
>> exec >  >(tee -a foo.log)
>> exec 2> >(tee -a foo.log >&2)
>>
>> Is there any alternative to the above statements? I find it troublesome,
>> that these processes aren't cleaned up after the script terminated.
>>
>
>you can put your code in, say, :
>main () {
>....
>}
>main "$@" | tee -a foo.log

Well stick me in the rear with a shish kabob stick and call me a dummy!

Funny how I simply overlooked this, while even knowing a little ASM/C!

A little more research shows:
Bashing Linux; Conventions; Posted August 1, 2009 by malkodan in Bash, Linux, 
System Administration forums.
http://bashinglinux.wordpress.com/2009/08/01/conventions/

Interesting read.  Number one reason I enjoy monitoring lists are for gems 
likes this. ;-)

This really gets into breaking code down into functions for increasing 
readability and reusability.  For which seems to be a feature based on one's 
skills.  (Breaking code down for increasing readability or easy comprehension, 
seems to be the standard for the creation of all computer languages.)



>Is it also recommended/possible to avoid involving "tee"? For
>> performance reasons maybe?

Ditto.  I only use tee when using the command line shell.


>> Cheers,
>> adrelanos

-- 
Roger
http://rogerx.freeshell.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]