I thought that this should be easy with bash, but unfortunately no.
My current attempt is
path_outside_another() {
PATH=$1
ANOTHER_PATH=$2
if ${$PATH%$ANOTHER_PATH} != $2 then
echo "inside"
else
echo "not inside"
fi
return 0
}
EDIT
With your help I was able to create this
path_starts_with_another_path() {
path1=$1
path2=$2
if [[ $path1 == "$path2"* ]]; then
echo "yes"
else
echo "no"
fi
}