I'm newbie for shell script now i have a problem to code so I try to grep "Concurrency Violation,Agent is calling clean for resource,became OFFLINE unexpectedly" in /var/adm/messages then print it out by other word on log.txt. Moreover, I need to check about the date(today), time(when the script run).
hi,
if u want to grep "Concurrency Violation,Agent is calling clean for resource,became OFFLINE unexpectedly" and put the result ta an another file and also want the date and time then try this
#!/bin/sh
echo `date`
grep 'Concurrency Violation,Agent is calling clean for resource,became OFFLINE unexpectedly' FILENAME >> outfilename.txt
if it not work just replace the single code with double code
Regards,
Pankaj
thank u, it's help me a lot