Scripting: awk reg. exp.
From: Green, Simon (Simon.Green_at_EU.ALTRIA.COM)
Date: 12/05/03
- Previous message: John F Riordan: "IBM Support for p650, HMC, DLPARS"
- Next in thread: Bill Verzal: "Re: Scripting: awk reg. exp."
- Reply: Bill Verzal: "Re: Scripting: awk reg. exp."
- Reply: Robert Binkley: "Re: Scripting: awk reg. exp."
- Maybe reply: Green, Simon: "Re: Scripting: awk reg. exp."
- Maybe reply: Sunder Iyengar: "Re: Scripting: awk reg. exp."
- Maybe reply: Green, Simon: "Re: Scripting: awk reg. exp."
- Maybe reply: Sunder Iyengar: "Re: Scripting: awk reg. exp."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 5 Dec 2003 17:04:09 +0100 To: aix-l@Princeton.EDU
Hi!
I'm trying to write a little script to automate some changes to
/etc/qconfig: changing certain host names. I've decided to use awk even
though (or perhaps "because") I'm not very familiar with it.
So far, I've come up with:
{sub(/host = old_name/,"host = new_name");print}
...and that works fine, except that it will also make changes to entries
which have been commented out, which I would prefer to avoid.
Is there some way of constructing the command so that it does not select
those lines which have been commented out? Remember: /etc/qconfig uses an
asterisk as a comment-character, which is damn stupid!
Simon Green
Altria ITSC Europe Ltd
AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html
AIX FAQ at http://www.faqs.org/faqs/aix-faq/
N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.
- Previous message: John F Riordan: "IBM Support for p650, HMC, DLPARS"
- Next in thread: Bill Verzal: "Re: Scripting: awk reg. exp."
- Reply: Bill Verzal: "Re: Scripting: awk reg. exp."
- Reply: Robert Binkley: "Re: Scripting: awk reg. exp."
- Maybe reply: Green, Simon: "Re: Scripting: awk reg. exp."
- Maybe reply: Sunder Iyengar: "Re: Scripting: awk reg. exp."
- Maybe reply: Green, Simon: "Re: Scripting: awk reg. exp."
- Maybe reply: Sunder Iyengar: "Re: Scripting: awk reg. exp."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]