Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
subsitutions and beginning of lines.
- X-seq: zsh-users 20736
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: subsitutions and beginning of lines.
- Date: Sun, 11 Oct 2015 12:12:26 -0700
- 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
${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