I'm trying to create a function that will do a grep on strings from an array that are sent as arguments but I can't get the quotation marks to work as I want.

> 
> 
> ```
> LOG=/tmp/log.log
> function grepCheck () {
>     if grep $1 ; then
>     STATE="true"
>     else
>     STATE="false"
>     fi }
> 
> possibleErrors=("string1 string1 string1" "string2 string2 string2")
> 
> for checkError in ${possibleErrors[*]}
> do
> grepCheck "${possibleErrors[$checkError]} $LOG"
> done
> 
> ```
> 
> 

Output example:

```
+ LOG=/tmp/log.log
+ possibleErrors=("string1 string1 string1" "string2 string2 string2")
+ for checkError in '${possibleErrors[*]}'
+ grepCheck 'string1 string1 string1 /tmp/log.log'
+ grep string1 string1 string1 /tmp/log.log grep: string1: No such file or directory grep: string1: No such file or directory

```

How do I get the function to grep the string that it recieves?