LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2007, 09:31 AM   #1
jimigoon
LQ Newbie
 
Registered: Jun 2007
Posts: 3

Rep: Reputation: 0
Bash script to detect hardware


Hi this is my first post and i am very new to Linux. Although i am quickly seeing the light

I am trying to write a bash script that can be run as part of an installation to detect what hardware is present on the target machine. I have spent a while messing around with different commands and exploring the proc and dev directories but feel that this is a rather clumy way of doing things.
Basically i want to obtain a list of the hardware but i don't really want to check all the different directories and where required parse the relevant info. I have also looked at prtdiag but again this would require parsing the relevant info.

Please don't think i'm being lazy i'm just trying to obtain the most efficient and elegant solution.

if anyone can point me in the right direction, has some advice or has been in this situation please let me know.

Thanks
 
Old 06-28-2007, 11:00 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
On my Debian box, I use lspci, lshw, and lsusb to find out everything I need.
 
Old 06-29-2007, 02:04 AM   #3
jimigoon
LQ Newbie
 
Registered: Jun 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the reply. I have been using lspci and lsusb but lshw doesn't work on my slax machine. Do you know of a command that will produce similar results.
 
Old 06-29-2007, 03:02 AM   #4
jimigoon
LQ Newbie
 
Registered: Jun 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I have found a module that solves my problem (detecting hardware). If anyone is interested the link is:

http://www.slax.org/modules.php?id=2574

Now i just have to get the info out. Thanks for the help pljvaldez.......
 
Old 06-30-2007, 09:22 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
There's a very good script called sysinfo which gives lots of hardware info -even BIOS specs if you have bmidecsoe installed. The script has a dialog front-end for easy use and is a single executable file which can be copied into your path anywhere.

Because the name is rather ubiquitous I'll include a link to the script:
http://developer.novell.com/wiki/ind....3/SYSINFOV2.3
 
  


Reply



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
aplicaton for hardware detect? berac Linux - Hardware 1 06-19-2005 07:58 AM
Bash Script to Detect USB drive mount status nutthick Programming 6 02-02-2005 08:17 AM
bash script to detect scsi address at boot ewto Programming 2 10-20-2003 02:47 AM
Detect hardware configuration Ivan Garcia Linux - Hardware 4 08-14-2002 05:08 AM
How to detect hardware hotrodowner Linux - Hardware 1 06-11-2002 10:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:31 AM.

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