LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-21-2004, 03:17 PM   #1
slownet
LQ Newbie
 
Registered: Mar 2004
Location: VA
Posts: 2

Rep: Reputation: 0
Question How to use shell script to get removable devices?


Hi,

I am writing a program in RedHat (9.0) to display whole list of devices to users. To simplify programming, I am using shell scripts to collect devices information.

The question is: how can I get removable devices (USB, Fireware, etc) information using shell scripts? Is there any command or API to call?

Thanks.
 
Old 03-22-2004, 01:22 PM   #2
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
If you look in /proc you'll find a bunch of files for this - theres a file for CPU info, memory info etc...

There should be enough information in there for you to get these devices (althoguh with some of it you might want to learn sed, [B]awk[/B and possibly cut (just handy for getting information out of chunky files)...
 
Old 03-23-2004, 10:16 AM   #3
slownet
LQ Newbie
 
Registered: Mar 2004
Location: VA
Posts: 2

Original Poster
Rep: Reputation: 0
I know how to use awk and cut, but is there any better way to get hardware information? There directory structure is not same for each type of removable device. Also, I am not quite sure about those directory structures.

There is a command Kudzu in redhat that seems good enough to configure device. But I don't know how to call that command to get device information.

Do you know how to use kudzu command (or API) or other commands to get device information? Thanks a lot!
 
  


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
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
shell script to detect IDE devices kushalkoolwal Programming 8 09-28-2005 11:15 AM
Does dpkg work with removable devices? jolphil Debian 13 03-23-2005 03:14 PM
Debian and removable devices. Sslaxx Debian 2 02-09-2005 01:24 PM
how to stop mandrake/kde from automounting nonexistent removable devices at startup? pdmackenzie Mandriva 3 11-08-2004 09:53 AM

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

All times are GMT -5. The time now is 10:06 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