[CentOS] text processing problem with bash/perl
Robinson Tiemuqinke
hahaha_30k at yahoo.comFri Feb 13 00:46:46 UTC 2009
- Previous message: [CentOS] OT: Suggestions for connecting a postfix to an sms box
- Next message: [CentOS] text processing problem with bash/perl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, Anyone has some ways for the following text processing problem? I have a text file containing two stanzas attached below. I want to uncomment the stanza with 'host=localhost' line, while left the other stanza unchanged. ... /* udp_send_channel { host=localhost port = 10017 ttl = 1 } */ /* udp_send_channel { host=ganglia100.ec2.example.com port = 10017 ttl = 1 } */ ... If I use command below then both stanza will be altered... Please help. sed -i -e '/^\/\* udp_send_channel/, /} \*\// {s/^\/\* udp_send_channel/udp_send_channel/g; s/\} \*\//}/g; }' --David
- Previous message: [CentOS] OT: Suggestions for connecting a postfix to an sms box
- Next message: [CentOS] text processing problem with bash/perl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list