Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: extraction of a string from one another



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