Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: regular expressions and setting variables?



"William G. Scott" <wgscott@xxxxxxxx> wrote in
news:157E3510-D220-4C1C-A452-93DE96DA4363@xxxxxxxxxxxxxxxxxx:

> 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
:
>
> 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




Messages sorted by: Reverse Date, Date, Thread, Author