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

c - sscanf() double showing zeros -

pentaho - Carte Status / Kettle Slave Server Status page shows status for random runs instead of the latest run -