LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-25-2011, 03:36 PM   #1
dannycalgarysci
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
Taking output from lspci and using as input


Hi everyone! I've used this forum for some quick tips over the past and everyone seems pretty helpfun so I decided it's time to join. Anyways hoping to get some input on a problem I'm having.

I want to take the output from lspci | grep VGA and grab the BusID's of each video card installed on a server. I then want to take these BusID's and convert them to decimal (Which I can do fine). I then want to take these numbers and have them as the input of a few perl search and replace commands for xorg.conf. I'm mostly stuck on trying to get each BusID that is outputted from lspci and using them as inputs (or variables).

Thanks for any help, and I hope this was the right area to post this in.
 
Old 03-25-2011, 03:50 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Is this what you are looking for:
Code:
lspci | awk '/VGA/ { print $1 }'
Hope this helps.

EDIT:

Store output in variable:
Code:
busID=$(lspci | awk '/VGA/ { print $1 }')

Last edited by druuna; 03-25-2011 at 03:57 PM. Reason: How to store in variable
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lspci -xxx output hyl1227 Linux - Newbie 1 08-25-2009 12:32 PM
lspci -vvv output Oxagast Linux - Hardware 0 10-29-2008 11:24 AM
no output from lspci *Xenny* Linux - Software 23 07-13-2006 05:42 PM
Understanding the output of lspci kushalkoolwal Linux - Hardware 4 07-05-2006 11:35 PM
Changing the output of lspci GT_Onizuka Linux - General 2 04-30-2004 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration