Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Read file with escaped newlines into array
- X-seq: zsh-users 21536
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Read file with escaped newlines into array
- Date: Tue, 10 May 2016 16:26:22 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1ut7au7J0lUYGOSMkgOvYwjL/zyDTl2PrXaBBejVhmM=; b=bIDP00bpYOAHHpwDYlObSU4vHUXvS38bxh+uIeJAez/Z2S40c+8M27ekhtqeZCgY4d pqcYaM5+0+b/pkNdr9WmVU3zLg7Faj1Et3kttS+s7tTESGXnzeizUkM3Xv5zOLsrt+3J xZ3c3ujt4yVTRZFVJ6oPlAIt3eohic98Mq97yfFdiRfsgtLw3ADRJKAsPZGG1EkFxLJH 4bB59RfLgCSoz/cVKhR01O/fjUCI0PA5cAmceRry8hH2zN8geMeI4Z3G/TizizM/+oy9 LzHHqYz4FGWMl6KJ1FLpxcEuZXhk6atwf+59u+FWsqf9T6XYJpL8jv1aSiZ+E4lhjkvj AO1A==
- In-reply-to: <151119111749.ZM8874@torch.brasslantern.com>
- 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
- References: <CAKc7PVCZzEfKkcWyPUb58ffmne6E8Eh6_CDpeLc0efd6hEQAow@mail.gmail.com> <151119111749.ZM8874@torch.brasslantern.com>
On 19 November 2015 at 20:17, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author