Not really a bug, but this seems to be the only bash list gname knows about, so...

I am trying to figure out how to run a command and pipe the output through tee, and then check the status of the original command. Normally I am a very competent shell programmer, but this one has me stumped!

I have tried all of the following with no success (except of course the last one):

my_false() { false || ret=3; }

ret=0
{ false || exit 1; } | tee none
{ false || ret=2; } | tee none ; [ $ret -eq 0 ] || exit $ret
my_false | tee none ; [ $ret -eq 0 ] || exit $ret
false | tee none || exit 4
false || exit 5

Please, someone tell me I'm just doing it wrong, and this is not a limititation in bash!

--
Matthew
Download. Untar. Configure. Make. Install. Lather. Rinse. Repeat.



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to