
if [ -z `echo $BASH | grep bash` ]; then
    >&2 echo "sourced: warning: not running bash, some scripts may malfunction"
fi

__sourced() {
    local d=$1
    [[ -z "$d" || ! -d "$d" ]] && return
    local f
    for f in $d/*.sh; do
        if [[ -r $f ]]; then
            . $f
        fi
    done
}

__sourced $1

unset -f __sourced
