From owner-freebsd-questions@FreeBSD.ORG Fri Aug 25 18:30:31 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F29F16A509 for ; Fri, 25 Aug 2006 18:30:31 +0000 (UTC) (envelope-from mjkarki@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60D7F43D70 for ; Fri, 25 Aug 2006 18:30:21 +0000 (GMT) (envelope-from mjkarki@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so992103uge for ; Fri, 25 Aug 2006 11:30:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=kEXAFjkXRcg3CNUv6Q2qDBWb9v6PreBEG6VCdqPJyjpL8+s/bLyeJsER48yo7t0eluSmwD+FldLVkROfCmCRIo+3vL9RyHt81fGa8bi1jOGHmfAgpPPMiLE2mJGaow+bC8CNfRSxuuNnAhxCV6kjHxfg1OZYSNPfje2tOI7Sno4= Received: by 10.66.252.4 with SMTP id z4mr2053345ugh; Fri, 25 Aug 2006 11:30:20 -0700 (PDT) Received: by 10.67.101.7 with HTTP; Fri, 25 Aug 2006 11:30:20 -0700 (PDT) Message-ID: <1b15366e0608251130j41aa582fx77be81c29ed295a0@mail.gmail.com> Date: Fri, 25 Aug 2006 21:30:20 +0300 From: "Matti J. Karki" Sender: mjkarki@gmail.com To: "Giorgos Keramidas" In-Reply-To: <20060825173135.GE78862@gothmog.pc> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7.0.1.0.2.20060824145822.0194fc10@broadpark.no> <1b15366e0608240618j62d41ad3j537f095b2e566ed5@mail.gmail.com> <7.0.1.0.2.20060824192439.02386de8@broadpark.no> <1b15366e0608241209t1d655b5fl98063ecb6221b0a8@mail.gmail.com> <7.0.1.0.2.20060825152152.02385da8@broadpark.no> <20060825173135.GE78862@gothmog.pc> X-Google-Sender-Auth: 8f1bfb75f772f029 Cc: questions@freebsd.org, Kyrre Nyg?rd Subject: Re: Code beautifiers, anyone? 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: Fri, 25 Aug 2006 18:30:31 -0000 On 8/25/06, Giorgos Keramidas wrote: > On 2006-08-25 15:24, Kyrre Nyg?rd wrote: > > At 21:09 24.08.2006, Matti J. Karki wrote: > > > > >Well, my scripts aren't magic. They are pretty simple. Here's few (not > > >scripts, these are valid Vim regexps): > > > > Those are great regexps, Matti, thank you so much. > > > > They have been noteworthy recorded! > > > > Say, could I use these with Sed let's say in a Bash script? > > > > One more question about :%s/^ *$//g versus :%s/ *$//g, > > won't the latter here perform the job of the former? > > They are different for a reason, I guess: > > The first one matches lines that only have spaces (it fails > spectacularly with lines that have a mix of TAB vs. SPACE characters > though, unless you pre-expand TABs). > > The second one only removes trailing SPACEs from a line. > Yes, you are correct. However, the latter of those regexps should do the job of the former, so Kyrre was also right. I just play safe with regexps. -Matti