my 2009 solution return code before grep
( ( ( mycmd echo $? >&3 ) |grep mytext >&4 ) 3>&1 |(read x;exit $x) )4>&1
my 2025 solution
mycmd > >(grep mytext)
my 2009 solution return code before grep
( ( ( mycmd echo $? >&3 ) |grep mytext >&4 ) 3>&1 |(read x;exit $x) )4>&1
my 2025 solution
mycmd > >(grep mytext)