Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Apr 2016 08:52:44 +0200
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        "Ronald F. Guilmette" <rfg@tristatelogic.com>, freebsd-ports@freebsd.org
Subject:   Re: Deriving base port/package names
Message-ID:  <5707553C.40008@quip.cz>
In-Reply-To: <51300.1460083670@server1.tristatelogic.com>
References:  <51300.1460083670@server1.tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ronald F. Guilmette wrote on 04/08/2016 04:47:
>
> Given a list of all current FreeBSD ports/package, such as a (plain text
> version) the list found here:
>
>     https://www.freebsd.org/ports/master-index.html
>
> and assuming that all text past the ' -- ' has already been deleted
> from each line, what would be a proper sort of sed command to extract
> _just_ the port/package names, without the version numbers attached?

If your plaintext master-index xontains full lines like this

yorick-2.2.04_1 -- Interpreted language for scientific simulations

Than you can use this sed line

# sed 's/-[0-9a-z.,_+]* --.*$//g' master-index.txt

If you have the index stripped to

yorick-2.2.04_1

This will do the trick
sed 's/-[0-9a-z.,_+]*$//g' master-index.txt

Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5707553C.40008>