Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zip arrays exclude empty elements
- X-seq: zsh-users 26057
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: sergio <sergio@xxxxxxxxxxxxx>
- Subject: Re: zip arrays exclude empty elements
- Date: Sat, 5 Sep 2020 17:21:56 -0700
- Archived-at: <https://zsh.org/users/26057>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-09/CAH%2Bw%3D7a6xD2D_S7rktwU9XSenSu9VqBZTavfUqT5j7sUGGhV7Q%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f169.google.com) smtp.remote-ip=209.85.167.169; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/TyCBuvOc4lObgEw0lLTqo9KcCgfrSASIHgB1LzuqGM=; b=oFa5vjh2bZ5ZUC7f9GLNWNJ64raQcNySoDYzbN2lhrcvIWszBn8TpAs8yVwOavH6YV T+DzkNPN4+JIdA8B9mI5sJb6HZS8qZZF1MVed3ugLj7bN4lzzIFTkQ8rClSr5ZMEXupA 9igNAum/Qp0KlEFKXxyDa1s0iAOlwIFZIDUbvQxVcxMjbYcHbJQluKN+zVX940/9Oxng dvQ/vUfUJ9deZJqQgETXUSfzyuggdc717iyBmoOx1ce4QmehPxq3B2ZtFZFR3Hx+wDsj BXKvkJlhnBCoIlHc/ki5qzcLnkHaXk1D4o3KnWDKBqgx/VMvlXJ0u5etJ1HOHvqvud5R mgKQ==
- In-reply-to: <0b12bc3e-6d96-db88-8e6c-2a3e1ca85c84@outerface.net>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <0b12bc3e-6d96-db88-8e6c-2a3e1ca85c84@outerface.net>
- Sender: zsh-users-request@xxxxxxx
On Fri, Sep 4, 2020 at 3:03 PM sergio <sergio@xxxxxxxxxxxxx> wrote:
>
> I have an input string in form of 'A[-][B]' that I'd like to translate
I'm not sure if you consider the following to be simpler, but it
doesn't rely on exactly two letters in the split string:
setopt extendedglob
print -r -- ${=${(@s.-.)crop}/(#b)(?)/-${(L)match[1]} ${match[1]}}
Remove the "=" if you want e.g. "-a A" instead of "-a" and "A" as
separate words.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author