From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: subsitutions and beginning of lines.
Date: Sun, 11 Oct 2015 12:12:26 -0700 [thread overview]
Message-ID: <561AB49A.4060801@eastlink.ca> (raw)
${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.
next reply other threads:[~2015-10-11 19:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-11 19:12 Ray Andrews [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561AB49A.4060801@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).