[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature Request: scanf-like parsing
From: |
pepa65 |
Subject: |
Re: Feature Request: scanf-like parsing |
Date: |
Sat, 23 Jan 2021 00:47:58 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 22/01/2021 23.10, Léa Gris wrote:
> I'd prefer a syntax based off:
>
> command-list > >(command-list)
> command-list < <(command-list)
>
> But with curly braces for the no sub-shell version:
>
> command-list > >{ command-list;}
> command-list < <{ command-list;}
>
> Which could be used to assign output of a command to a variable without
> a sub-shell:
>
> mapfile -t users < <{ compgen -u; } # No sub-shell
That would be great. Of course mapfile maps lines to entries in an
array, but if I want them in a single variable, perhaps this could do:
{ ls;}>>>variable
Or even (if people prefer):
mapvar variable < <{ ls;}
It is otherwise very hard to get command output into a variable without
a subshell.
Peter
- Re: Feature Request: scanf-like parsing, (continued)
- Re: Feature Request: scanf-like parsing, Léa Gris, 2021/01/25
- Re: Feature Request: scanf-like parsing, Chet Ramey, 2021/01/25
- Re: Feature Request: scanf-like parsing, Greg Wooledge, 2021/01/25
- Re: Feature Request: scanf-like parsing, Chet Ramey, 2021/01/25
- Re: Feature Request: scanf-like parsing, pepa65, 2021/01/26
- Re: Feature Request: scanf-like parsing, Oğuz, 2021/01/26
- Re: Feature Request: scanf-like parsing,
pepa65 <=
- Re: Feature Request: scanf-like parsing, Greg Wooledge, 2021/01/22
- Re: Feature Request: scanf-like parsing, Léa Gris, 2021/01/22
- Re: Feature Request: scanf-like parsing, Léa Gris, 2021/01/22
- Re: Feature Request: scanf-like parsing, pepa65, 2021/01/22
- Re: Feature Request: scanf-like parsing, Ángel, 2021/01/22
- Re: Feature Request: scanf-like parsing, pepa65, 2021/01/22
- Re: Feature Request: scanf-like parsing, William Park, 2021/01/22