n4txuw
Last Updated: February 25, 2016
·
536
· sheerun
Photo on 08.01.2013 at 04.15

POSIX way to check if command is shell function

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

is_function cd && echo 'Yes it is'
Say Thanks
Respond