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

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -