linux - Check if a function exists before executing it in shell -
i want check if function exist or not before executing in shell script.
does script shell support that? , how it?
as read in this comment, should make it:
type -t function_name
this returns function
if function.
test
$ type -t f_test $ $ f_test () { echo "hello"; } $ type -t f_test function
note type
provides informations:
$ type -t ls alias $ type -t echo builtin
Comments
Post a Comment