Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th November 2007, 08:38 PM
elgaza Offline
Registered User
 
Join Date: Nov 2007
Posts: 24
piping question

Hi

This must be easy for you guys.

I am trying to get info about certain packages that I have in a text file

something like this:

cat file > yum info (this is where I get stuck, I get info for all packages not just
whats in the file, how do pass an argument in pipes)

Thank you.
Reply With Quote
  #2  
Old 26th November 2007, 08:47 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
Try

yum info `cat file`

The back ticks use the output of the command as command line arguments. There is a limit to the length of the command line, but it's pretty big. If you don't have a huge number of files, you should be ok.
Reply With Quote
  #3  
Old 26th November 2007, 08:54 PM
elgaza Offline
Registered User
 
Join Date: Nov 2007
Posts: 24
didnt work
Reply With Quote
  #4  
Old 26th November 2007, 09:00 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
Well then, list a bit of the 'file' so we have a better clue. If file has things like

kdebase
kdelibs
kdenetwork

it'll work just fine.
Reply With Quote
  #5  
Old 26th November 2007, 09:01 PM
elgaza Offline
Registered User
 
Join Date: Nov 2007
Posts: 24
a2ps.i386 4.13b-69.fc8 installed
aspell-en.i386 50:6.0-8.fc8 installed
aspell-he.i386 1.0-2.fc8 installed
autofs.i386 1:5.0.2-16 installed
BackupPC.noarch 3.0.0-3.fc8 installed
binutils.i386 2.17.50.0.18-1 installed
bittorrent.noarch 4.4.0-5.fc7 installed
bonnie++.i386 1.03a-7.fc8 installed
bsf.i386 2.3.0-11jpp.1 installed
bsh.i386 1.3.0-9jpp.2 installed
cadaver.i386 0.23.0-2 installed
ccid.i386 1.2.1-3.fc8 installed
coolkey.i386 1.1.0-5.fc8 installed
dejavu-fonts-experimental.noarch 2.20-1.fc8 installed
dejavu-fonts.noarch 2.20-1.fc8 installed
dialog.i386 1.1-2.20070704.fc8 installed
elinks.i386 0.11.3-6.fc8 installed
evolution-help.i386 2.12.1-3.fc8 installed
fetchmail.i386 6.3.8-3.fc8 installed
gd.i386 2.0.35-1.fc8 installed
gettext.i386 0.16.1-12.fc8 installed
gimp-help.noarch 2-0.2.0.13.fc8 installed
gnome-user-docs.noarch 2.20.1-1.fc8 installed
groff-perl.i386 1.18.1.4-10.fc8 installed
gsm.i386 1.0.12-5.fc8 installed
hpijs.i386 1:2.7.7-6.fc8 installed




and so forth
Reply With Quote
  #6  
Old 26th November 2007, 09:05 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
cat file|sed -e "s/ installed//g" - |xargs yum info
Reply With Quote
  #7  
Old 26th November 2007, 09:10 PM
elgaza Offline
Registered User
 
Join Date: Nov 2007
Posts: 24
this is amazing so simple you see I basicaly installed on vmware fedora 8 from livecd and one from the dvd distro and wanted to see the differences in packages involed so that I could get the same as if installed from the dvd

but for some reason I dont get it acording to the list which is sorted
Reply With Quote
  #8  
Old 26th November 2007, 09:15 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
Why not just do

yum list installed|sort >filedvd
and the same thing for your vm install

and then do a

diff filedvd filevm|more

As long as you have the same locale selected (so sort works the same way on both) that should show the differences in installed packages very quickly.
Reply With Quote
  #9  
Old 26th November 2007, 09:20 PM
elgaza Offline
Registered User
 
Join Date: Nov 2007
Posts: 24
thank you this too has worked well excep that it also generated extra characters like < in every line
and some numbers, not that it matters so much

this was great learning for me

thank you very much.
Reply With Quote
  #10  
Old 26th November 2007, 10:09 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 52
Posts: 1,013
man diff will tell you more about what you see

Basically < and > indicate lines in one file or the other file, but not both. The numbers with d, c, or a, indicate line numbers in the file with deleted, changed, or added.
Reply With Quote
Reply

Tags
piping, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trivia(l) Question: piping 'more' & 'less' lose pretty colors Hlingler Using Fedora 2 27th June 2008 04:47 AM
Question about piping yum to tee AlFrugal Using Fedora 5 30th May 2007 08:33 PM
Piping to a printer chris_y2k_r1 Using Fedora 4 18th March 2006 11:38 PM
piping to X display teethlikelions Using Fedora 13 2nd March 2006 08:12 PM


Current GMT-time: 10:42 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat