**Hi my current code is:**

```
find /home/user/logfilesError/ -maxdepth 1 -type f -name "gBatch_*"\
 -daystart -mtime -1 -exec grep -rl "ERROR" "{}" +  | xargs -l  basename

if [ $? -eq 0 ]; then
    tday="$(date +'%d.%m.%Y')"
    echo "ERROR found on $tday in the files obove!"

else
    tday="$(date +'%d.%m.%Y')"
    echo "No ERROR was found at the $tday !"
fi

```

The code currently outputs the logfiles wich are created or edited this day(not last 24 hrs) and searches if the logfiles contain "ERROR" and simply says in which logfiles is an error or if there aren´t any error he says that aswell. 

I censored the names a bit so dont think I messed that up and thats why it doesn´t work ;-)

**Output(example):**

```
gBatch_2070.log
gBatch_2071.log
ERROR found on 25.06.2014 in the files obove!

```

**The folder looks like:**

![folder](https://i.stack.imgur.com/svsUI.jpg)

**Each file looks like:**

![file](https://i.stack.imgur.com/6IAXk.jpg)

**My desired output:**

Name of the file + "ERROR" + the message after the error

Example:

gBatch\_2067.log - ERROR \*\*.batch.BatchStart = Batchverarbeitung beeendet, gBatch\_2077.log - ERROR \*\*.batch.BatchStart = Batchverarbeitung beeendet, ... 

Thank you in advance for your help!