Bash Find out the exit codes of all piped commands
In Bash, you can find out the exit code of each piped command by checking the exit code of the last command in the pipe. To do this, you can use the special shell variable $? which contains the exit code of the last executed command. For example, consider the following command: command1 | command2 … Read more