I'm having an issue with pattern matching. I know the solution to this should be relatively simple but I'm stuck. Lets say
for something in ${OPTARG[@]} ; do
[[ ${path} =~ "J"${something} ]]
In this case, I want OPTARG = 1
When I run this it returns all matches to 1 i.e. J112, J174 etc and I ONLY want it to return J1
Any ideas?