1752727 Members
5861 Online
108789 Solutions
New Discussion юеВ

Re: Scripting issue - 2

 
SOLVED
Go to solution
Dewa Negara_4
Regular Advisor

Scripting issue - 2

Hi All,

I have a file called file1 as below:

#more file1
passwd.hp_sap_is_tmp@bdhp4297:cane*p:UNKN APP,C/O THYS/DT,NL,,
passwd.hp_sap_is_tmp@bdhp4337:cane*p:UNKN APP,C/O THYS/DT,NL,,
passwd.hp_sap_is_tmp@bdhp4338:test:UNKN APP,C/O THYS/DT,NL,,


When I tried to grep "cane*p" using command #grep "cane*p" file1 or #grep 'cane*p' file1, it gave me nothing.

How can I grep "cane*p" from file1, so the output will be as below:
passwd.hp_sap_is_tmp@bdhp4297:cane*p:UNKN APP,C/O THYS/DT,NL,,
passwd.hp_sap_is_tmp@bdhp4337:cane*p:UNKN APP,C/O THYS/DT,NL,,

Please help.

Thanks and Best Regards,
Dewa
Santos
4 REPLIES 4
Oviwan
Honored Contributor
Solution

Re: Scripting issue - 2

Hi

this should work:
more file1 | grep cane\\*p

Regards

Dewa Negara_4
Regular Advisor

Re: Scripting issue - 2

Thanks a lot. It's working well.
Santos
Peter Godron
Honored Contributor

Re: Scripting issue - 2

Dewa,
grep -F 'cane*p' file1

should work
Arturo Galbiati
Esteemed Contributor

Re: Scripting issue - 2

Hi,
grep "cane\*p" file1
HTH,
Art