Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: extraction of a string from one another
- X-seq: zsh-users 30123
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Mark J. Reed" <markjreed@xxxxxxxxx>
- Cc: aegy <aegy@xxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: extraction of a string from one another
- Date: Sun, 8 Dec 2024 01:41:47 -0800
- Archived-at: <https://zsh.org/users/30123>
- In-reply-to: <CAA=-s3xVqMM+=xc+GBFeuerGobsuOCxzA7dpnXDWxZbw-VAipw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <473ab10d-04d2-4da2-958e-1ef00afa9640@free.fr> <CAA=-s3y+XXFnS4+1_qvQOqbwVOsnUWSDSUFWYLBK9ftiba2zow@mail.gmail.com> <CAA=-s3xVqMM+=xc+GBFeuerGobsuOCxzA7dpnXDWxZbw-VAipw@mail.gmail.com>
On Sun, Dec 8, 2024 at 12:59 AM Mark J. Reed <markjreed@xxxxxxxxx> wrote:
>
> I don't think there's a solution using builtins that doesn't require two lines of code, though I could be wrong.
Hmm. Starting from your first split solution, just join again:
${(j:/:)${"${(@s[/])h}"}[1,3]}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author