Bash
See 'return codes' from Commands Inside a Chain of Pipes (pipeline)
It can be hard to tell if everything went okay inside a chain of pipes since $? will only report the return code from the final command in the chain. Using a different variable ($PIPESTATUS) the return codes of all the commands chained together can be found. #!/bin/bash # as long