#!/bin/bash
mask="/var/log/WARNING*"
logfile="tmp/error.log"
rm $logfile
for file in $(ls -l $mask)
do
while read line
do
echo $line >> $logfile
done < $file
echo $line >> $logfile
done
grep -E -h -s "/[a-z]{2,}/\S+" $logfile
exit 1
rm: cannot remove 'tmp/error.log': No such file or directory
rm -f $logfile
for file in $(ls -l $mask) do while read line do echo $line >> $logfile done < $file echo $line >> $logfile done
find -name "$mask" -type f -print0 | xargs -0 cat >> $logfile