From owner-freebsd-questions Thu Sep 27 23: 2:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id 9A28537B40F for ; Thu, 27 Sep 2001 23:02:27 -0700 (PDT) Received: from moo.holy.cow (sdn-ar-008dcwashP331.dialsprint.net [63.178.90.237]) by snipe.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f8S621C09208; Thu, 27 Sep 2001 23:02:02 -0700 (PDT) Received: by moo.holy.cow (Postfix, from userid 1001) id DADD450BAA; Fri, 28 Sep 2001 02:02:02 -0400 (EDT) Date: Fri, 28 Sep 2001 02:02:02 -0400 From: parv To: "David S. Jackson" Cc: f-q Subject: Re: regex w/ sed and bash expression Message-ID: <20010928020202.A3002@moo.holy.cow> Mail-Followup-To: "David S. Jackson" , f-q References: <20010927002134.A30622@sylvester.dsj.net> <20010927010644.A27260@moo.holy.cow> <20010927163858.A2643@sylvester.dsj.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010927163858.A2643@sylvester.dsj.net>; from dsj@sylvester.dsj.net on Thu, Sep 27, 2001 at 04:38:58PM -0400 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 this was, on the fateful occasion around Sep 27 16:38 -0400, sent by David S. Jackson > > On Thu, Sep 27, 2001 at 01:06:44AM -0400 parv wrote: > > hi again david, > > > > how about this... > > > > # echo '[ ] popop l' | perl -p -e 's#([\W])#\\$1#g' > > You know, I like Jim's and Fletch's response: > > file=`echo '[foo (bar) baz]' | perl -ne 'print quotemeta $_'` use of 'quotemeta' function makes the program more readable, i must say... but introduces need of 'print' function due to -n option. thanks for sharing as other responses didn't seem to make the list. in any case, let me remove some junk from my response... # echo '[ ] popop l' | perl -p -e 's#(\W)#\\$1#g' - parv -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message