Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created January 15, 2014 18:17
Show Gist options
  • Select an option

  • Save coderofsalvation/8441407 to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/8441407 to your computer and use it in GitHub Desktop.
determines whether receiving from pipeline (return 0) or from terminal/tty
# determines whether receiving from pipeline (return 0) or from terminal/tty
# usage: is_pipeline && cat -
is_pipeline(){
[[ -t 0 ]] && return 1 || return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment