此脚本检查一个目录是否是另一个目录的父目录。如何工作这个脚本?
T() {
if [[ "$2" =~ ${1}['/'?] ]] ; then
echo "$2 is child of $1"
return 0
else
echo "$2 is NOT child of $1 ($?)"
return 1
fi
}