0

I'm doing a scipt to search a log file with an age and compare who has a string of text within the log, if it is correct to proceed to make a function, but not effected. I appreciate any advice or help

#!/bin/bash
file= find /AUX/backup/log/ -iname "*.log" -daystart -type f -mtime 1
if cat $file | grep -qw “INF - Status = completed."  
then
  echo "there is OK" 
else
  echo "there is KO" 
fi
Guru
  • 16,456
  • 2
  • 33
  • 46
user1980835
  • 11
  • 1
  • 2

1 Answers1

0
#!/bin/bash
file=`find /AUX/backup/log/ -iname "*.log" -daystart -type f -mtime 1`
if grep -qw “INF - Status = completed."  < $file
then
  echo "there is OK" 
else
  echo "there is KO" 
fi
DigitalRoss
  • 143,651
  • 25
  • 248
  • 329
  • Please add the explanation too, it is difficult to spot the added \` chars... (even with syntax highlight...) – ppeterka Jan 15 '13 at 16:04