Click to See Complete Forum and Search --> : turning file lines (or stdin lines) into command line parameters


fracture
11-30-2001, 07:19 PM
I'm going through my RH installation trying to cut out as many .rpms as I can. (I orginially installed EVERYTHING. Yowsa, those CDs are full of stuff. :rolleyes: )

Now I took the output of rpm -qa and dumped it into a file, and I'm going through the file deciding what to cut. At the end I'm going to have a list of all the packages to remove, one to a line, in a big file. I then want to be able to pass them all in one big block to rpm -ev. This means I need to be able to turn the individual lines into a long stream of arguments. A friend once told me there was a command to do this, but I can't remember it anymore! What is it?

I'm also wanting to use it to pass the output of rpm -q --provides to rpm -q --whatrequires to see what packages need a particular package I'm considering. I could also be doing this using the --test parameter, but I'd still like to know the command.

:confused:

Frac

bwkaz
11-30-2001, 07:56 PM
I just answered a question similar to this yesterday. But, what the heck, I'll repeat myself. Nothing better to do.

rpm -ev `cat filename`

You send the contents of filename to stdout, then you use that output on the rpm command line. That's what the backquotes are for (the backquote is usually the unshifted tilde key).

The other command would look like this:

rpm -q --whatrequires `rpm -q --provides`

Again, use backquotes.