Last Updated: February 25, 2016
·
854
· sheerun

POSIX way to check if command is shell function

is_function() {
  test "$(command -v "$1")" = "$1"
}

is_function cd && echo 'Yes it is'