From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23685-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 829b1270 for ; Fri, 28 Sep 2018 08:29:55 +0000 (UTC) Received: (qmail 1606 invoked by alias); 28 Sep 2018 08:29:39 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23685 Received: (qmail 1125 invoked by uid 1010); 28 Sep 2018 08:29:39 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.167.45):SA:0(-1.9/5.0):. Processed in 2.119039 secs); 28 Sep 2018 08:29:39 -0000 X-Envelope-From: jesper.nygards@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=O0UvowSbM9t/oD5PHfp0k49ODjB1QtlWJ3U90l7cOkI=; b=G3/J6InV1jxbbqOSxF7sk6PK+xo8gE8rLSCuHJ03Vxeqq85DudYCIrHUD686M7gGpK 8BtFfvOyz77PWgCglLY6ez98NDR/rdmiCxshCclhLsZ72gTuZbLzayM6m30dk2Dje5yh kEyLgfBgFgjhuI2Vah1ILNtRausl4uv3YWN5F86isIaQiVyN3vc4HZTGNZX/U7vGc7YD EoBhy3+2Q2n0uzU3yNzEGWmAee++itVA2JqXop1IoN6GEl5KdgT7I5TRJWb4kOTViW3m ob+h2fKABqLH8x6ZyFGaOGQ2qXr7pdObmmUnxa4zCGQ4fE/GgExVUlmNObBAye+SM6h4 +FWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=O0UvowSbM9t/oD5PHfp0k49ODjB1QtlWJ3U90l7cOkI=; b=sbd59OW2ReJ27juB/0STSGasNzyymHF9eIeZu7kkfLuGAC5m2AJPhp7lO1DKZgY9TO QSoxXgzx2EXzDzKCNVHbUVOnROciPcrzjd2bQbHqlyrX/9BmYJoiVW/NrQoRnU/g9SQ7 NfR9b5bejiXsdVrPcLWG85UZJILrYh6H+IdHuDTwaAgXwYhsyW0M2Co5LqXf3g9JK3RX tt/paHP0/llP6zgMOd+5Igag5CLVtLV5zLSdJHZnc/QiyUWVqo/dT5ZjhdPedhSDQhX4 mqgINVPDGJD9dPNebpiVHWsR0NJ6XJ0PcLATa2kMmMTuOhXrEGzP5yGdv1YoXo8RgBh/ V9FQ== X-Gm-Message-State: ABuFfoivVeHQhK9/2ii33BQVrOofxYcHefkYQ7UhxXCQH80d+zRip9Fh 7faJ9UcewG8IU/hxoHTSVXr9+gaEIfMHWnfeldoHJg== X-Google-Smtp-Source: ACcGV62NNq7HyhjPn1QGePkAqQW7whio0l/Jh3o93tQoBLR90pPOaSsTKb/2nADtfhk8OykuXzjU6WR5uKZ69TGO/mI= X-Received: by 2002:a19:1603:: with SMTP id m3-v6mr9509333lfi.82.1538123372431; Fri, 28 Sep 2018 01:29:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Fri, 28 Sep 2018 10:29:21 +0200 Message-ID: Subject: Re: Split on unquoted space To: Zsh Users Content-Type: multipart/alternative; boundary="0000000000003c0edb0576ea41f0" --0000000000003c0edb0576ea41f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Never mind, this was indeed a problem I did not really have: I had prematurely joined an array into a string, and then wanting to split the string caused my problem. Not joining the array in the first place was the obvious solution. On Fri, Sep 28, 2018 at 9:22 AM Jesper Nyg=C3=A5rds wrote: > This might well be a case of me not understanding my problem, but is ther= e > a way to use parameter expansion to split only on unquoted spaces? > > If I have myvar=3D"my\ string", ${=3Dmyvar} results in "my\" and "var", = i.e. > zsh doesn't care about the fact that the space is quoted. > > On the other hand, myvar=3D"my\ var", ${(z)myvar} does respect the quoted > space and makes no split, but then myvar=3D"my|var", ${(z)myvar} results = in > "my" "|" "var", which is not what I want in this case. > > So in short, is there a way to only split on space, but not split on a > quoted space? > > --0000000000003c0edb0576ea41f0--