Last Updated: February 25, 2016
·
781
· sheerun

POSIX way to check if command is shell function

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

is_function cd && echo 'Yes it is'