Skip to content

Instantly share code, notes, and snippets.

@atomize
Created May 8, 2018 23:47
Show Gist options
  • Save atomize/612eaea62d1096ef00765e567fee0761 to your computer and use it in GitHub Desktop.
Save atomize/612eaea62d1096ef00765e567fee0761 to your computer and use it in GitHub Desktop.
Advance I/O redirection in bash. /dev/null
For those unfamiliar with 'advanced' i/o redirection in bash:
1) 2>&- ("close output file descriptor 2", which is stderr) has the same result as 2> /dev/null;
2) >&2 is a shortcut for 1>&2, which you may recognize as "redirect stdout to stderr".
See the Advanced Bash Scripting Guide i/o redirection page for more info.
– mikewaters Dec 21 '11 at 19:48
-comment from : https://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
@atomize
Copy link
Author

atomize commented May 8, 2018

sometimes 7 year old comments on Stack Overflow are still very useful =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment