Skip to content
Browse files

Create command_exists

  • Loading branch information...
1 parent 2e8a961 commit e967ee65656db9f6fdbb2df35d84e67c216842a5 @booch booch committed Mar 7, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 sbin/command_exists
View
8 sbin/command_exists
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Determine whether a command exists on the system and in the $PATH (or an alias, function, or builtin).
+# Returns 0 (true) if the command exists, otherwise 1 (false).
+
+
+type -P "$1" > /dev/null 2>&1;
+exit $?

0 comments on commit e967ee6

Please sign in to comment.
Something went wrong with that request. Please try again.