From owner-freebsd-questions@FreeBSD.ORG Wed Sep 29 10:06:51 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 803D1106566B for ; Wed, 29 Sep 2010 10:06:51 +0000 (UTC) (envelope-from lhmwzy@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 396C98FC12 for ; Wed, 29 Sep 2010 10:06:50 +0000 (UTC) Received: by qyk30 with SMTP id 30so807759qyk.13 for ; Wed, 29 Sep 2010 03:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=/LBHsGfCbUr1gX7Vu4l2qM98j4fhTLZpAWmCz9A+4eU=; b=KBLqGJl+KFO87Up648Wi/2v6DeUm2Fnl2No4xFMGs47/fgAi6G9SFWRqJ0Dj9nU/0h U3Z4pqmfjABIQKC2VmyVWiVf+LsqShw+u62VkNAfG9KGeFbDXkPVzM61sAEkKzYXa8xH X+bUzdkz5pCoLf5Egl+hqX63A/QNAQFTV26jY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JgTw/6w5kSRRhx/KxQw/uC54MgVNKUrVzFDYDWglknF3pLBp5zDgakayOIPw8Q8afq T04LUVSDn7+1xuEipCGBx6OTSbF/TSTcCTXX6RikIKCfW3Ds3b02/A7cmFoECh1FJQAS 0KCQgggmun30jVRMVJRAOmKS8dcqw9EBWgDxE= MIME-Version: 1.0 Received: by 10.224.37.11 with SMTP id v11mr911194qad.374.1285753387868; Wed, 29 Sep 2010 02:43:07 -0700 (PDT) Received: by 10.229.95.81 with HTTP; Wed, 29 Sep 2010 02:43:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 29 Sep 2010 17:43:07 +0800 Message-ID: From: lhmwzy To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: sed problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2010 10:06:51 -0000 #%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 4 17:58:13 CST 2009 lhm@bxzxfreebsd.slof.com:/usr/obj/usr/src/sys/lhmwzy amd64 2010/9/29 lhmwzy : > 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? >