zsh-users
 help / color / mirror / code / Atom feed
* subsitutions and beginning of lines.
@ 2015-10-11 19:12 Ray Andrews
  2015-10-11 20:09 ` Peter Stephenson
  2015-10-12  2:26 ` Daniel Shahaf
  0 siblings, 2 replies; 17+ messages in thread
From: Ray Andrews @ 2015-10-11 19:12 UTC (permalink / raw)
  To: Zsh Users

${var// /}

When doing that sort of substitution, is is possible to test for newlines?
I'm playing with a function that grabs history and I'm trying to strip
off the leading numbers.  At one point I have the output captured in a
variable and various forms of substitution come close, but the substitution
treats the entire variable as one entity whereas I want the substitution
to be performed fresh on each new line of output.  I can't find any
specific newline character.  OTOH if the variable was an array there'd
probably be some way of processing each line as a separate entity, which
would serve fine. I know I'm close, but I can't quite bag it.


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

end of thread, other threads:[~2015-10-14  5:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 19:12 subsitutions and beginning of lines Ray Andrews
2015-10-11 20:09 ` Peter Stephenson
2015-10-11 23:05   ` Ray Andrews
2015-10-12  9:34     ` Peter Stephenson
2015-10-12 15:44       ` Ray Andrews
2015-10-12 17:07         ` Ray Andrews
2015-10-13  2:29           ` Bart Schaefer
2015-10-13  2:50             ` Ray Andrews
2015-10-13  5:03               ` Bart Schaefer
2015-10-13  5:24                 ` Ray Andrews
2015-10-13 19:58                   ` Bart Schaefer
2015-10-13 21:42                     ` Ray Andrews
2015-10-14  0:23                       ` Bart Schaefer
2015-10-14  5:03                         ` Ray Andrews
2015-10-12  2:26 ` Daniel Shahaf
2015-10-12 15:53   ` Ray Andrews
2015-10-12 16:42     ` Peter Stephenson

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