grep command in Solaris x86 to Capture Special character

135 Views Asked by At

I want to capture perticular string i.e. "UPDATE kplustp..Service SET Service_Name = "PositionService", ServiceType = 'Z', HostName = "abcd" " in log file with perticular path /home/abc/xyz.log

I am using below command to do

grep -i "UPDATE kplustp..Service SET Service_Name = "PositionService", ServiceType = 'Z'" /home/adc/xyz.log 

But it is not working, may be because of special characters in string.

How to do?

1

There are 1 best solutions below

4
On

Don't have my solaris box at hand, but try this:

grep -i 'UPDATE kplustp..Service SET Service_Name = "PositionService", ServiceType = \'Z\'' /home/adc/xyz.log