Advertisement
Guest User

Untitled

a guest
Jul 13th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. function __cmd.is_callable() {
  2.     local cmd_type=`type -t $1`
  3.  
  4.     if [[ (-n $1) && (("$cmd_type" == @(builtin|function)) || ("$cmd_type" == @(file|alias) && -x `which $1`)) ]]; then
  5.         echo 'YES we CAN use this command'
  6.     else
  7.         echo 'NO we CAN NOT use this command'
  8.     fi
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement