zsh-users
 help / color / mirror / code / Atom feed
From: Kurtis Rader <krader@skepticism.us>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: string to array space problem in filenames
Date: Wed, 2 Sep 2015 21:48:17 -0700	[thread overview]
Message-ID: <CABx2=D_M+ijjcbjh2yY1C2zwzU6BvMF9kivRrFQwXvqF3pv-Vw@mail.gmail.com> (raw)
In-Reply-To: <55E7C084.2060505@eastlink.ca>

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

On Wed, Sep 2, 2015 at 8:37 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:

> On 08/28/2015 12:43 PM, Bart Schaefer wrote:
>
> Bart,
>
> Got around to the spaces in filenames thing:
>
>>
>> If you insist on storing it all on one line, then you need to quote the
>> spaces on the way out:
>>
>>      echo -n " ${(q)PWD}" >>! ~/.mydirstack;
>>
>> I've got it all more or less working except I can't figure out how to
> write the array--with newlines now, not with spaces--back to the file.
> Everything I try ends up on one line, which is now not what I want anymore.
>

See the "F" flag in the "Parameter Expansion Flags" of the "man zshparam"
page:

Join  the  words of arrays together using newline as a separator.  This is
a shorthand for `pj:\n:'.


For example:

$ set -A x a b c
$ echo $x
a b c
$ echo ${(F)x}
a
b
c

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

  reply	other threads:[~2015-09-03  4:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 20:50 zsh 5.0.8-test-2 Peter Stephenson
2015-08-22  0:10 ` Matthew Martin
2015-08-22  0:30   ` Michael Beasley
2015-08-22  0:45     ` Matthew Martin
2015-08-22 11:48   ` Jun T.
2015-08-22 17:04     ` Matthew Martin
2015-08-23  8:31     ` Daniel Shahaf
2015-08-23 12:45       ` Jun T.
2015-08-28  2:05 ` string to array space problem in filenames Ray Andrews
2015-08-28  3:15   ` Mikael Magnusson
2015-08-28 18:54     ` Ray Andrews
2015-08-28 19:43       ` Bart Schaefer
2015-08-28 20:42         ` Ray Andrews
2015-08-28 20:56         ` Peter Stephenson
2015-09-03  3:37         ` Ray Andrews
2015-09-03  4:48           ` Kurtis Rader [this message]
2015-09-03  5:25           ` Bart Schaefer
2015-09-03  5:53             ` Mikael Magnusson
2015-09-03 15:23             ` Ray Andrews
2015-09-03 15:30               ` Mikael Magnusson
2015-09-03 15:58                 ` Ray Andrews
2015-09-03 16:08                   ` Peter Stephenson
2015-09-03 16:11                 ` Ray Andrews
2015-09-03 17:11                   ` Ray Andrews
     [not found]                 ` <55E86E0C.1000806__15798.3473306105$1441295967$gmane$org@eastlink.ca>
2015-09-03 16:21                   ` Stephane Chazelas
2015-08-28  9:40   ` Peter Stephenson
2015-08-28 19:02     ` Ray Andrews
2015-08-28 19:45       ` Bart Schaefer
2015-08-28 20:35         ` Ray Andrews

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='CABx2=D_M+ijjcbjh2yY1C2zwzU6BvMF9kivRrFQwXvqF3pv-Vw@mail.gmail.com' \
    --to=krader@skepticism.us \
    --cc=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).