sed help !!!!

 
SOLVED
Go to solution
kampatel
Occasional Advisor

sed help !!!!

I have a file which contains parameters as below:

[NFC774L2] Yes 07/30/11
[NFC773L2] Yes 07/24/11
[NFC784L2] Yes 07/24/11
[NFC787L2] Yes 07/31/11

 

I want to replace them as
NFC774L2 Yes 07/30/11
NFC773L2 Yes 07/24/11
NFC784L2 Yes 07/24/11
NFC787L2 Yes 07/31/11

 

I want to remove the [ ]'s kindly assist how I do the same via shell script.

2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: sed help !!!!

Hi:

 

You will need to escape the opening and closing bracket character:

 

# sed -e 's/\[//' -e 's/\]//' file

 

Regards!

 

...JRF...

kampatel
Occasional Advisor
Solution

Re: sed help !!!!

Thanks.. It is working.