The `check_output` function is already implemented. It shouldn't be that difficult to base `check_out` and `check_err` on it.