Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
regular expressions and setting variables?
- X-seq: zsh-users 18893
- From: "William G. Scott" <wgscott@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: regular expressions and setting variables?
- Date: Mon, 9 Jun 2014 22:04:20 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=679zZVobqihcablUn5imBeM3Y0uFiTOOWncdu7hscq8=; b=Ki9mjOGikVhCkKejdD7RYOy0FYXuoZkSuTfdy/tqIy+UXAX2/DC18j9K5wCnKb8QIg P+IbQD97yKblbQKfog9Oz7tylZTLmTUe1Palk9NirupToA6w+VcGeFyu6r7Apcbucu3P BqKYofAmQRCQzjxWLXW/Mt+GoQnqV4srA4zks=
- 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
Hi folks:
I’m 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 complications in the unix filesystem.
This works:
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/\.$/_}
it returns
R.E.M.
I assume I am not using the correct regexp. What do I need to do to get this working?
Thanks in advance.
Bill Scott
Messages sorted by:
Reverse Date,
Date,
Thread,
Author