n4txuw
Last Updated: February 25, 2016
·
562
· sheerun

POSIX way to check if command is shell function

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

is_function cd && echo 'Yes it is'
Filed Under