From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 598 invoked by alias); 10 Jun 2014 14:12:12 -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: 18896 Received: (qmail 14056 invoked from network); 10 Jun 2014 14:12:06 -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=-0.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: zzapper Subject: Re: regular expressions and setting variables? Date: Tue, 10 Jun 2014 14:11:45 +0000 (UTC) Organization: Your Company Message-ID: References: <157E3510-D220-4C1C-A452-93DE96DA4363@chemistry.ucsc.edu> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 2.25.238.191 User-Agent: Xnews/2009.05.01 X-Antivirus: avast! (VPS 140610-1, 06/10/2014), Outbound message X-Antivirus-Status: Clean "William G. Scott" wrote in news:157E3510-D220-4C1C-A452-93DE96DA4363@chemistry.ucsc.edu: > Hi folks: > > I=92m trying to emulate how iTunes changes some names of directories it > creates based on names of artists. For example, albums by the group > R.E.M. are stored in a directory it creates called R.E.M_ > > The final full-stop is replaced with an underscore, I assume to avoid : > > JUNK=3DR.E.M. > print ${JUNK}| perl -p -e 's|\.$|_|g=92 > > It returns > R.E.M_ > > > But if I try to do this: > > print ${JUNK/\.$/_} > JUNK=3DR.E.M. print ${JUNK/\.(#e)/\_} -- zzapper https://twitter.com/dailyzshtip --- This email is free from viruses and malware because avast! Antivirus protec= tion is active. http://www.avast.com