( while read x
  do foobar bop || exit 1
  done <file ) &&
outside subshell