zsh-users
 help / color / mirror / code / Atom feed
* parameter expansion with '$'
@ 2015-02-25 20:50 Kartik Agaram
  2015-02-25 21:18 ` Roman Neuhauser
  0 siblings, 1 reply; 3+ messages in thread
From: Kartik Agaram @ 2015-02-25 20:50 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

Hi,

Consider this example:

$ X=abc
$ echo ${X/c/}
ab

However, I'd like to only perform the substitution when 'c' occurs at the
end of the string:

$ echo ${X/c$/}
abc  # I'd like this to return 'ab' like above

I assume others see the same results? Can anybody help me understand why it
doesn't work, and how I can interpret the '$' as a regular expression
wildcard rather than some other sort of zsh sigil?

Thanks,
Kartik
zsh 5.0.5 on x86_64 with extendedglob

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-25 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 20:50 parameter expansion with '$' Kartik Agaram
2015-02-25 21:18 ` Roman Neuhauser
2015-02-25 21:20   ` Kartik Agaram

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).