From: zzapper <david@rayninfo.co.uk>
To: zsh-users@zsh.org
Subject: Re: regular expressions and setting variables?
Date: Tue, 10 Jun 2014 14:11:45 +0000 (UTC) [thread overview]
Message-ID: <XnsA3489A9395B19davidrayninfocouk@80.91.229.13> (raw)
In-Reply-To: <157E3510-D220-4C1C-A452-93DE96DA4363@chemistry.ucsc.edu>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
"William G. Scott" <wgscott@ucsc.edu> wrote in
news:157E3510-D220-4C1C-A452-93DE96DA4363@chemistry.ucsc.edu:
> Hi folks:
>
> Im 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=R.E.M.
> print ${JUNK}| perl -p -e 's|\.$|_|g
>
> It returns
> R.E.M_
>
>
> But if I try to do this:
>
> print ${JUNK/\.$/_}
>
JUNK=R.E.M.
print ${JUNK/\.(#e)/\_}
--
zzapper
https://twitter.com/dailyzshtip
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
next prev parent reply other threads:[~2014-06-10 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 5:04 William G. Scott
2014-06-10 6:17 ` Roman Neuhauser
2014-06-10 8:45 ` Phil Pennock
2014-06-10 14:26 ` William G. Scott
2014-06-10 14:11 ` zzapper [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-06-10 5:02 William G. Scott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=XnsA3489A9395B19davidrayninfocouk@80.91.229.13 \
--to=david@rayninfo.co.uk \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).