Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to use character range [] in substitution pattern :gs
- X-seq: zsh-users 17065
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: reckoner <reckoner@xxxxxxxxx>
- Subject: Re: how to use character range [] in substitution pattern :gs
- Date: Wed, 9 May 2012 16:23:20 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=qnyTODk2qZlt9IFQl/N8ztA62Nxuiv9k+MFmhpOdFHE=; b=q7x+7uq3Jpr1Drg+ULCaI3MwgLXbZ7WqR7fKe0905JtnZl5NbBQq5TIq2x17JpoSwt 0gOBJab57cuuSgutSnuWKRvzMV6vu8AoxvK6FYnM+RlknNjws9+Sidl3QCL/NHSlys3k +LXITrCWv5RQxtUJYHZQ9wSNNK1++jbx1enjGfwBtpCi6vUHpbefj95ZDFG2h+FgHLdy Re34PV+BbgBC8IDknvkjZXKiVx7kaKLnq29aw7kBi6ur9I5kayVyIlq61c7GARZi/5dl zltj1fMRwFgyVEvizi3P9osilm/yyFpuHtROV5qZe+ap60Z14/tpDxJV0Ip8MNRP6i62 WV9g==
- In-reply-to: <4FAA78BD.3020602@gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4FAA78BD.3020602@gmail.com>
Hi,
2012/5/9 reckoner <reckoner@xxxxxxxxx>:
> 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.
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author