There is some kind of file.xml
<data_set type="1"> <data_model type="2"> </data_model> <data_model type="3"> <data_model type="3"> </data_model> </data_model> </data_set>
And there is a script on the regexp.sh bash
main_file="./file.xml" while read str do if [[ "$str" =~ <data_[az]{3}+>$ ]] then echo "$str" >> $debugt else echo "$str" >> $debugf fi done < "$main_file"
However, when executing an error
./regexp.sh: line 12: syntax error at line 19: `~(E)<data_[az]{3}+>$ ]] then echo "$str" >> $debugt else echo "$str" >> $debugf fi done < "$main_file"./regexp.sh: line 12: syntax error at line 19: `' unexpected
not quite clear what the problem is. and how to fix it. Perhaps IMHO the problem is with braces