[LTP] [RFC] [PATCH] shell: ROD_SILENT: Print std{out, err} on failure

Cyril Hrubis chrubis@suse.cz
Tue Mar 13 13:46:47 CET 2018


Hi!
> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index d6b638549..48afb9cc4 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -118,8 +118,9 @@ tst_brk()
> >  
> >  ROD_SILENT()
> >  {
> > -	tst_rod $@ > /dev/null 2>&1
> > +	local tst_out=$(tst_rod $@ 2>&1)
> >  	if [ $? -ne 0 ]; then
> > +		echo "$tst_out"
> >  		tst_brk TBROK "$@ failed"
> >  	fi
> >  }
> > -- 
> > 2.13.6
> 
> LGTM except that you could maybe use ${ } instead of $( ) as a small
> optimisation.

I do not get it either. Where should I put the ${} insetad of $()?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list