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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -