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

subsitutions and beginning of lines.



${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.



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