Skip to content

Instantly share code, notes, and snippets.

@bdenckla
Created November 4, 2011 21:23
Show Gist options
  • Save bdenckla/1340519 to your computer and use it in GitHub Desktop.
Save bdenckla/1340519 to your computer and use it in GitHub Desktop.
bash script illustrating pipefail
#!/bin/bash
false; echo "false alone: $?"
false | head; echo "false piped to head: $?"
set -o pipefail
false | head; echo "false 'pipefailed' to head: $?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment