Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: autoload variables
- X-seq: zsh-users 27046
- From: Marc Chantreux <eiro@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Anthony Fletcher <anthony@xxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: autoload variables
- Date: Wed, 1 Sep 2021 10:29:50 +0200
- Archived-at: <https://zsh.org/users/27046>
- Dkim-filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org 33104103F8
- In-reply-to: <CAN=4vMr9DiCejUiWeLfB6M29Jj4qb+kuKAuYR-n-X-riMqAVcQ@mail.gmail.com>
- 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>
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 //' ?
> 2. If a portion of the line matches '^default.*dev', remove it
i realize i assumed in the first place that 'default dev' was the only
valid part but i just saw there can be a 'via something' subpart.
> 1. Take the first line.
that's what i was afraid about. does ip r garanty that? my version was
sed '
/^default.*dev /!d # do nothing until you find a match
# so the next commands applies only on the valid line
s///d # remove what you just found
s/ .*//d # remove the tail of the sentence
q # print and quit
'
Regards
marc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author