I want to check if an input string matches whitelisted file paths, then only I want to perform some operation.
I am doing something like this
path1="mydir/**" path2="mydir/testing" [ [ "$path2" =~ "$path1" ] ] && echo "Matches"
Where, if paths are like
These should pass.
Above check is giving me an error
assets/bin/copymain: line 8: [: too many arguments