I am writing bash script for checking that "child mounts" doesn't exits before "parent mounts" on fstab
i.e: if I have the following mounts on fstab:
good: fstab mount point first
/Application
second
/Application/home
bad: fstab mount point first
/Application/home
second
/Application/
so I want to loop all the mount points on fstab and compare the match to regex that will check regex of "mount point" +/ to catch all child mount points in this case I want to catch any mount point that have /application/ mount point
I am trying
for child in $MATCH;do
if [[ "$child" =~ [//application//] ]];then
echo "$child has child mounts before it"
fi
done
by it catches more matches as expected please help me with the correct regex
- - , .
برچسب:
نویسنده: استخدام کار