possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread L A Walsh


Is there a way, in bash, to filter stderr and let the
filtered result continue on stderr with the original
stdout being output on stdout?

with prog being the program to filter, and RE_filt being the
filtering expression, conceptually, I wanted to do something
like this:

$prog >&3 2>&1 |grep -v "$RE_filt" >&2 3>&1

(which of course doesn't work)

Is it possible/doable?

Tnx!
-l







Re: possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread Dennis Williamson
On Tue, Dec 6, 2016 at 4:09 PM, L A Walsh  wrote:

>
> Is there a way, in bash, to filter stderr and let the
> filtered result continue on stderr with the original
> stdout being output on stdout?
>
> with prog being the program to filter, and RE_filt being the
> filtering expression, conceptually, I wanted to do something
> like this:
>
> $prog >&3 2>&1 |grep -v "$RE_filt" >&2 3>&1
>
> (which of course doesn't work)
>
> Is it possible/doable?
>
> Tnx!
> -l
>
>
>
>
>
>
http://mywiki.wooledge.org/BashFAQ/047 (search for "stdout intact")






-- 
Visit serverfault.com to get your system administration questions answered.


Re: possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread L A Walsh



Dennis Williamson wrote:


http://mywiki.wooledge.org/BashFAQ/047 (search for "stdout intact")


Thanks!




Re: possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread Andreas Schwab
{ $prog 2>&1 >&3 | grep -v "$RE_filt" >&2; } 3>&1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread L A Walsh



Andreas Schwab wrote:

{ $prog 2>&1 >&3 | grep -v "$RE_filt" >&2; } 3>&1

Andreas.
  

Closer to my last failed case:

   ( echo -n >&3 $($prog >&3 2>&1 | grep -Pv "$re" >&2 ) ) 3>&1

Had tried not putting $prog in $(), but bash didn't like the parens...

At that point figured it was probably solved and asked onlist...

Thanks for the added input!

-l




Re: Could bash do what make does?

2016-12-06 Thread Robert Durkacz
On 6 December 2016 at 00:19, Greg Wooledge  wrote:

>  what evidence?
> ​ [for shell scripting builds]
>
​
I suppose the evidence that you want is in the very same wikipedia article
about make, where it says precisely that shell scripts were used before
make came along.
However, please remember I am here asking a question. I am not promoting
any views about these matters which are secondary to the question. There is
no onus on me to prove anything. If you are interested in my views and I
doubt you are, you can email me privately. I will not indulge you in
further public exchanges no matter how provocative you try to be. "Put up
or shut up" indeed.


Re: Could bash do what make does?

2016-12-06 Thread Dave Finlay
There is an onus on you to use the appropriate mailing list. Bug-bash isn't
for make-ing your case, bug-bash is for the bugs.

Dave Finlay

On Dec 6, 2016 15:44, "Robert Durkacz"  wrote:

On 6 December 2016 at 00:19, Greg Wooledge  wrote:

>  what evidence?
> ​ [for shell scripting builds]
>
​
I suppose the evidence that you want is in the very same wikipedia article
about make, where it says precisely that shell scripts were used before
make came along.
However, please remember I am here asking a question. I am not promoting
any views about these matters which are secondary to the question. There is
no onus on me to prove anything. If you are interested in my views and I
doubt you are, you can email me privately. I will not indulge you in
further public exchanges no matter how provocative you try to be. "Put up
or shut up" indeed.