Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: autoload variables
- X-seq: zsh-users 27047
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Marc Chantreux <eiro@xxxxxxxxx>
- Cc: Anthony Fletcher <anthony@xxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: autoload variables
- Date: Wed, 1 Sep 2021 11:51:30 +0200
- Archived-at: <https://zsh.org/users/27047>
- In-reply-to: <YS85/tOk0c9niPe4@prometheus.u-strasbg.fr>
- List-id: <zsh-users.zsh.org>
- References: <CAPT4cGdBZQDQv8ozkpgYwzm60yqmpJwCKCSPUnLaAj-Rp+F6kg@mail.gmail.com> <YS6TI9eVkktkyvfJ@prometheus.u-strasbg.fr> <CAN=4vMr9DiCejUiWeLfB6M29Jj4qb+kuKAuYR-n-X-riMqAVcQ@mail.gmail.com> <YS85/tOk0c9niPe4@prometheus.u-strasbg.fr>
On Wed, Sep 1, 2021 at 10:30 AM Marc Chantreux <eiro@xxxxxxxxx> wrote:
>
> Hi Roman,
>
> Le Tue, Aug 31, 2021 at 11:03:39PM +0200, Roman Perepelitsa a écrit :
> > sed -n -e '/^default/ s/^default.*dev //; s/ .*// p;q'
>
> > In plain English:
>
> english is fine. can you confirm that '/^default/ s/^default.*dev //'
> is a suttered way to say 's/^default.*dev //' ?
Yes, these are equivalent. Anything that matches '^default.*dev '
matches '^default'.
> that's what i was afraid about. does ip r garanty that?
I don't know. FWIW, I'd do it like this:
ip -j -4 r | jq -r '.[] | select(.dst == "default") | .dev'
This requires a new-enough version of ip to support json output.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author