#!/bin/bash
The command # 1
Bash - c "ls | grep error | grep yes"
# to print at this time is empty, should be only store the return status of the entire command 1
Echo ${PIPESTATUS [1]}
Solution # : but bash - c must be in the business scenario, how to get "grep error" status code?