0
 $ is_parent() { [[ "$2" =~ $1/? ]]; }

June 13, 2013, 11:03 p.m.Couannette

Explanation

The function expanded would look like this :

T() {
    if [[ "$2" =~ $1/? ]]; then
        echo "$2 is child of $1"
        return 0
    else
        echo "$2 is NOT child of $1 ($?)"
        return 1
    fi
}