yum list display some package in 2 rows
Allen Kistler
an037-ooai8 at yahoo.com
Sat Jan 31 20:04:39 UTC 2009
Ambrogio <fn050202 interfree it> wrote:
> I use yum list in a script to have everytime I need a list of package
> available.
>
> Some packages, that have long names, are displayed in 2 rows, so scripts
> are more hard to be coded.
>
> There is an option to have a more simple list of packages, less readable
> by umans, but more readable by computer?
I also have "yum list available" in a script. All the regular lines
begin with non-whitespace and all "additional" lines begin with
whitespace, so I pipe it through the following:
tr "\n" "#" | sed -e 's/# / /g' | tr "#" "\n"
Turn newlines into octothorpes; replace octothorpe+space with space
globally (i.e., delete the octothorpe if it's followed by a space);
replace octothorpes with newlines. It's predicated on the assumption
that there would never be an octothorpe in a yum listing. If there ever
is, then I'd have to pick another character.
It's a hack, but it works (so far).
More information about the fedora-list
mailing list