]> code.delx.au - dotfiles/commitdiff
bash: Added is_function()
authorJames Bunton <jamesbunton@delx.net.au>
Sat, 1 Sep 2012 06:04:38 +0000 (16:04 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sat, 1 Sep 2012 06:04:38 +0000 (16:04 +1000)
.bash/functions

index 5b597efeec5153aa69d9644430a01518e37daddc..383eb95cd7c5f7e17b45160e71c54d1212d2daae 100644 (file)
@@ -78,6 +78,12 @@ function slowshell {
        renice -n 19 -p $$
 }
 
+# Usage: is_function something
+# Check if a function exists
+function is_function {
+       declare -Ff "$1" > /dev/null
+}
+
 # Load local functions
 ssource "${HOME}/.bash/functions_local"