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

Re: autoload variables



On Tue, Aug 31, 2021 at 10:38 PM Marc Chantreux <eiro@xxxxxxxxx> wrote:
>
> besides: if the sed command is for real, i'm curious about
> how it works

The original sed command from the first email:

  sed -n -e '/^default/ s/^default.*dev //; s/ .*// p;q'

It's equivalent to this:

  head -1 | sed 's/^default.*dev //' | sed 's/ .*//'

In plain English:

  1. Take the first line.
  2. If a portion of the line matches '^default.*dev', remove it:
  3. If a portion of the line matches ' .*', remove it.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author