From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 211 invoked by alias); 9 May 2012 16:06:42 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17067 Received: (qmail 23694 invoked from network); 9 May 2012 16:06:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Ys05rPHGKGqfVVbO65Mhb9emsRiCshOYQEiaiKvKY1U=; b=n/eIgOnMZ3LkjJeUJp2nRzPo0DnyMLXfyuDhcfGAGaOf02/4ayfn5PpcWjaocE6spJ 6AvoSFSv6/L4v0P1Ulj4v+XrKKMTzNRWr/sd8+T2YDpakPrtDXErEupjUk1jzN75gtyW BkKKBgqNkC8wg8MHKPlHqqAMELdgX1thRskL5ACYogGaZc6WWmKu0XVsivxo3LIyY+P2 xM15uEpFxx/s1+P8pevy31WkqHcNO+yPs9ASoVFyWPRC8beXr2MM9oRydcWJsJcS7YXd ds5C7ygvJ2Lp8P4F5hwz68I12tFojHsJvXi59ry1Wz3mY2w65O6JSDCFmas6hb4rwMub AbeA== Message-ID: <4FAA94AB.40104@gmail.com> Date: Wed, 09 May 2012 09:00:43 -0700 From: reckoner User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Peter Stephenson CC: Zsh Users Subject: Re: how to use character range [] in substitution pattern :gs References: <4FAA78BD.3020602@gmail.com> <20120509153848.3d756e82@pwslap01u.europe.root.pri> In-Reply-To: <20120509153848.3d756e82@pwslap01u.europe.root.pri> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/9/2012 7:38 AM, Peter Stephenson wrote: > On Wed, 9 May 2012 16:23:20 +0200 > Jérémie Roquet wrote: >> 2012/5/9 reckoner: >>> I'm trying to use the the [] character range to substitute for embedded >>> parenthesis as in the following: >>> >>> % echo ${x:gs/[()]/_/} >>> >>> But This isn't working for some reason. It's not complaining about syntax, >>> so I'm pretty sure that I'm using the character range [] incorrectly >>> somehow. >> >> By default, the left side of a substitution is a string, not a >> pattern. You have to setopt HIST_SUBST_PATTERN to use patterns >> instead. > > Probably better to use the syntax that already handles this: > > ${x//[\(\)]/_} > This last one doesn't work for me with or without the HIST_SUBST_PATTERN. Thanks!