Is there a way to detect if an external command exists (i.e. wget, svn)? More specifically today, i was trying to run one of my scripts i wrote and the person didn't have wget or svn installed.The script just downloads a file extracts it or uses svn to export the trunk.
How would one  detect if external command exists in a script?
shell script;utilities;executable
In Bash the type shell built-in gives information about the executable things: aliases, functions, executables. See help type for details.# just check for existencetype -t 'yourfunction' > /dev/null || echo 'error: yourfunction not found'# explicitly check for given type[[ $( type -t 'yourfunction' ) != 'function' ]] && \    echo 'error: yourfunction not found or is not a function'