# Checking if we dealing with 1050 or 1050 Ti
function gpu_check() {
test="GPU 0: GeForce GTX 1050 (UUID: GPU-97acce0b-4304-01e9-ef9d-bc3230cae912)"
echo "testing $test"
if [[ $test =~ "\sGTX\s1050\s" ]]; then
echo "foud 1050"
else
echo "no 1050's here"
fi
}
i'm trying to use regex but all possible variants i can imagine, like double \, adding * and .*, using "$test" and many more, giving me not what i'm expecting.
testing GPU 0: GeForce GTX 1050 (UUID: GPU-97acce0b-4304-01e9-ef9d-bc3230cae912)
no 1050's here
How do i make it work?
\sis a PCRE-ism. It's not available in BRE or ERE regex syntaxes.