Wednesday, 7 August 2013

what is =~ in following script

what is =~ in following script

this script check that a directory is a parent of another
T() {
if [[ "$2" =~ ${1}['/'?] ]] ; then
echo "$2 is child of $1"
return 0
else
echo "$2 is NOT child of $1 ($?)"
return 1
fi
}

No comments:

Post a Comment