I'm writing a small script to test my regex understanding of comparison operator "=~". I thought that my syntax was alright but I keep getting:
3: Syntax error: "(" unexpected
this is my small script link to this syntax error :
#!/bin/bash
inputsArr=("ab" "67" "7b7" "g" "67777" "07x7g7" "77777" "7777" "")
for input in ${inputsArr[@]}; do
if [[ "$1" =~ "$input" ]]; then
echo "$?"
fi
done
I try to compare in a loop with an array some "strings" against my arg1 or "$1"