Perhaps you have enabled the errexit option in your bash script, but you have noticed that it may not stop executing if it gets an error when executing a command that pipes into another command. This is because when commands are executing in a pipe the status of the last…