Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2010 22:15:11 +0800
From:      lhmwzy <lhmwzy@gmail.com>
To:        Wayne Sierke <ws@au.dyndns.ws>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: sed problem
Message-ID:  <AANLkTim=UQsvE9ouqUTXufp4-kP2eyNqOdSA41UPK71i@mail.gmail.com>
In-Reply-To: <1285766018.90337.1198.camel@predator-ii.buffyverse>
References:  <AANLkTinA7oRwKW9GO5ZvvW8WtgEaOhXv-YQSYsP-%2BGK3@mail.gmail.com> <AANLkTimNZRUxJ9BSOpiMidhMCrO3iYjpL7_EPLOhS-o3@mail.gmail.com> <1285766018.90337.1198.camel@predator-ii.buffyverse>

next in thread | previous in thread | raw e-mail | index | archive | help
Both are working.
Thk very much.

2010/9/29 Wayne Sierke <ws@au.dyndns.ws>:
> On Wed, 2010-09-29 at 17:43 +0800, lhmwzy wrote:
>> #%sed -e '/GROUP/{/Test/! d}' test
>> sed: 1: "/GROUP/{/Test/! d}
>> ": extra characters at the end of d command
>> also have error.
>> the system:
>> #uname -a
>> FreeBSD bxzxfreebsd.slof.com 7.2-RELEASE-p5 FreeBSD 7.2-RELEASE-p5 #1:
>> Fri Dec =A04 17:58:13 CST 2009
>> lhm@bxzxfreebsd.slof.com:/usr/obj/usr/src/sys/lhmwzy =A0amd64
>>
>> 2010/9/29 lhmwzy <lhmwzy@gmail.com>:
>> > I have a txt file named test:
>> >
>> > USER Added by ftpadmin
>> > GENERAL 0,0 120 204800 0
>> > LOGINS 1 0 -1 -1
>> > TIMEFRAME 0 0
>> > FLAGS 3
>> > TAGLINE lanshu4385
>> > DIR /
>> > ADDED 1284812614 ftpadmin
>> > EXPIRES 0
>> > CREDITS 15000
>> > RATIO 0
>> > ALLUP 0 0 0
>> > ALLDN 0 0 0
>> > WKUP 0 0 0
>> > WKDN 0 0 0
>> > DAYUP 0 0 0
>> > DAYDN 0 0 0
>> > MONTHUP 0 0 0
>> > MONTHDN 0 0 0
>> > NUKE 0 0 0
>> > TIME 0 1284812614 0 0
>> > GROUP Teest 0
>> > GROUP eest 0
>> > GROUP dTeest 0
>> > GROUP tTeest 0
>> > GROUP Test 0
>> > IP *@*
>> >
>> > when I use the follow command:
>> >
>> > #sed -e '/GROUP/{/Test/}! d' test
>> > then output error:
>> >
>> > sed: 1: "/GROUP/{/Test/}! d
>> > ": command } expects up to 0 address(es), found 1
>> >
>> > But this command under linux is OK,how can I do?
>> >
>
> Try:
>
> =A0 =A0 =A0 =A0sed -e '/GROUP/{/Test/!d;}'
>
> or:
>
> =A0 =A0 =A0 =A0sed -e '/GROUP/{' -e '/Test/!d' -e '}'
>
>
> Wayne
>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTim=UQsvE9ouqUTXufp4-kP2eyNqOdSA41UPK71i>