SED help
- From: "Scott Ruckh" <sruckh@xxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 16:09:43 -0700 (MST)
I would like to do the following SED replacement, but I am not having much
luck and thought I would ask for help.
TEXT1="some-text a.b.c.d a.b.c.d a.b.c.d a.b.c.d"
TEXT2="some-text 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4"
sed -i "s/$TEXT1/$TEXT2/g" $INFILE
;a.b.c.d are unknown IP Addresses.
----------------------
I have tried this:
TEXT2="some-text 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4"
IP_REGEX="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][$
TEXT1="^some-text[ \t]${IP_REGEX}[ \t]${IP_REGEX}[ \t]${IP_REGEX}[
\t]${IP_REGEX}"
sed -i "s/$TEXT1/$TEXT2/g" $INFILE
----------------------
What I have does not work, and I need some assistance.
Your help is appreciated.
Thanks.
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- Follow-Ups:
- Re: SED help
- From: mark
- Re: SED help
- From: Herta Van den Eynde
- Re: SED help
- From: Scott Ruckh
- Re: SED help
- Prev by Date: openldap 2.3 on RHEL 4 - users changing their own passwords?
- Next by Date: Re: SED help
- Previous by thread: openldap 2.3 on RHEL 4 - users changing their own passwords?
- Next by thread: Re: SED help
- Index(es):
Relevant Pages
|