cat error.log.tmp1
2010-07-06 23:18:34 Connection Available to xyztestftp.abc.com.my
2010-07-06 23:20:33 Connection Available to xyztestftp.abc.com.my
ERROR FTP LOGIN
Now I am reading this complete log file if no single occurrence of word "ERROR" (this word if any will be the 1st word of the line only) then need to move a file to file.done otherwise do nothing.
For this I am using below code:
awk '/ERROR/{ if ($1 !~ /ERROR/) mv s s.done }' error.log.tmp1
But its not working can anyone tell me what is wrong?
Why are you altering that code? Why did you substitute "FILENAME" with "s"? Just change name of the file at the end of the command, and leave rest of the code the way it is.