From owner-freebsd-questions Fri Apr 5 21:42:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by hub.freebsd.org (Postfix) with ESMTP id D0BCC37B428 for ; Fri, 5 Apr 2002 21:42:11 -0800 (PST) Received: from earl-grey.cloud9.net (earl-grey.cloud9.net [168.100.1.1]) by russian-caravan.cloud9.net (Postfix) with ESMTP id 6E3B428E16; Sat, 6 Apr 2002 00:42:11 -0500 (EST) Date: Sat, 6 Apr 2002 00:42:11 -0500 (EST) From: Peter Leftwich X-X-Sender: To: Warren Block Cc: FreeBSD Questions Subject: Re: special charaters (return key) In-Reply-To: Message-ID: <20020406003533.V68445-100000@earl-grey.cloud9.net> Organization: Video2Video Services - http://Www.Video2Video.Com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 3 Apr 2002, Warren Block wrote: > > On Wed, 3 Apr 2002, Warren Block wrote: > > > perl -pi -e 's/\r//g' crt1.txt > Erik did an excellent job explaining it. I'll add two other things: > 1. The "g" flag after the final slash means to substitute all occurrences ("global") instead of just the first one. This is the same usage for the "sed" command-line command. Here's the sort of mnemonic I use to remember it: sed 's/this/that/g' _s_tream _ed_itor, 'like _s_ubstitute / this [with] / that / _g_lobally' (I used to think of the "g" as "_g_ood, now we're done" back in 1994ish.) > 2. The llama or camel O'Reilly books pay for themselves quickly. I prefer the first; most of the reference information I need from the camel book is in the man pages. > -Warren Block * Rapid City, South Dakota USA Those www.ora.com books are quite pricey, and the catch-22 of it all is you don't want to wait for the price to drop with time or buy an older used copy because (except in the case of regexp, for example) the current applications obsoletize :) -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message