bug-bash
[Top][All Lists]
Advanced

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

Re: xtrace output on new file descriptor


From: Brian J. Murrell
Subject: Re: xtrace output on new file descriptor
Date: Thu, 10 Dec 2009 22:38:34 -0500

On Thu, 2009-12-10 at 22:20 -0500, Chet Ramey wrote: 
> 
> Nothing good.

Pity.

> The next version of bash will allow you specify an arbitrary
> file descriptor where the xtrace output will be written.

Cool.  I wonder how long it will take the distros to pick that up
though.  Sure, I could build my own packages, but the distro/arch matrix
here makes that somewhat prohibitive.

I suppose by that same token trying to play with FDs so that:

foo() {

    echo "this is a message the user should see on stdout"

    echo "this is the function return value"
}

bar=$(foo)
echo "bar==$bar"

Yields:

$ foo.sh 2>/dev/null
this is a message the user should see on stdout
bar==this is the function return value

Is equally difficult?  Or can I more easily play with FD duplication and
redirection to achieve that, even if it means adding a ">&word" at the
end of things I want on the real stdout?

b.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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