Index ¦ Archives ¦ RSS

yet another cheap bash trick

Estimated read time: 1 minutes

#!/bin/bash

foo() { true }

if declare -f foo >/dev/null; then echo "foo() declared" else echo "foo() is not declared" fi

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.