From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Read file with escaped newlines into array
Date: Tue, 10 May 2016 16:26:22 +0200 [thread overview]
Message-ID: <CAKc7PVAevePDEG6JRUCKXy9UY1jzR5HodSRVd_C=yK2T2UkL4w@mail.gmail.com> (raw)
In-Reply-To: <151119111749.ZM8874@torch.brasslantern.com>
On 19 November 2015 at 20:17, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Nov 19, 6:34pm, Sebastian Gniazdowski wrote:
> }
> } fc -W stores history to a given file. It escapes newlines with \. How
> } to read such file into array and have "\^M" lines put back together
> } into single array entries?
>
> The best way is probably to use the history mechanism to read it:
>
> () { fc -ap -R the_given_file ; the_desired_array=( ${history} ) }
This works, but I wonder, how it's possible that zsh/parameter
variables such as $historywords are made local?
Best regards,
Sebastian Gniazdowski
next prev parent reply other threads:[~2016-05-10 14:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 17:34 Sebastian Gniazdowski
2015-11-19 19:17 ` Bart Schaefer
2015-11-19 20:14 ` Sebastian Gniazdowski
2016-05-10 14:26 ` Sebastian Gniazdowski [this message]
2016-05-10 16:15 ` Bart Schaefer
2016-05-10 18:10 ` Sebastian Gniazdowski
2015-11-20 1:17 ` Mikael Magnusson
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='CAKc7PVAevePDEG6JRUCKXy9UY1jzR5HodSRVd_C=yK2T2UkL4w@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=schaefer@brasslantern.com \
--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).