From owner-freebsd-questions@FreeBSD.ORG Sun Jan 14 20:31:59 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B7E116A407 for ; Sun, 14 Jan 2007 20:31:59 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 66DD013C45B for ; Sun, 14 Jan 2007 20:31:58 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup85.ach.sch.gr [81.186.70.85]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l0EKVIMm013398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 14 Jan 2007 22:31:32 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.13.8/8.13.8) with ESMTP id l0EKVBNG003516; Sun, 14 Jan 2007 22:31:12 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.13.8/8.13.8/Submit) id l0EKV5RI003515; Sun, 14 Jan 2007 22:31:05 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 14 Jan 2007 22:31:04 +0200 From: Giorgos Keramidas To: Gary Kline Message-ID: <20070114203104.GB3404@kobe.laptop> References: <20070114024551.GA21847@thought.org> <20070114034148.GC2734@kobe.laptop> <20070114201546.GA28048@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070114201546.GA28048@thought.org> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.729, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.47, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: perl substitution question 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: Sun, 14 Jan 2007 20:31:59 -0000 On 2007-01-14 12:15, Gary Kline wrote: > Thanks for all the ways, gents. (I never thought of tr, but now that > seems like an option.) A week+ ago I tried perl using 's/\xNN/"/g' > from the cmdline, but nojoy. The online docs said that \N{xx} would > catch a hex character; that's what was fuzzy. Watch out for shells with funny 'expansion rules', like csh(1) :) Even in sh(1) variants, it's always a good idea to save the Perl script in a file first, and test it independently of the shell, with: perl filter.pl < infile > outfile To avoid all the messy details about single-quotes, double-quotes, backquotes, stars, dollars, etc :)