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 09-30-2008, 12:19 AM   #1
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Rep: Reputation: 15
ifconfig command


how to get the data from the command
"ifconfig".

EX:
if we run the command "ifconfig" it will show the data.
something like "eth0" ,"eth1" and "lo".

these data should directly dump(mean do not copy the data into a file and r/w) in to treeview.
here i have to take 2 treeview.
treeview1 output should be,
Quote:
ifconfig (here this is the path name)
eth0(these are sub paths like a tree)
eth1
lo
treeview2 output should be,
the data which contains after "eth0"
Quote:
Link encap:Ethernet HWaddr 00:08:A1:90:49:46
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:23 Base address:0xa000
 
Old 09-30-2008, 07:42 AM   #2
ghodkiller
Member
 
Registered: Jan 2005
Distribution: SuSE / Mandrake
Posts: 48

Rep: Reputation: 15
you can try ifconfig > data.txt

Debian

Last edited by ghodkiller; 10-19-2008 at 07:24 AM.
 
Old 09-30-2008, 08:01 AM   #3
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ghodkiller View Post
you can try ifconfig > data.txt
thats what am saying.
any way to direct dump in to gtktreeview.

dont have to use file concept.
 
Old 09-30-2008, 08:07 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I don't know anything about treeview, but one tool that seems applicable is address ranges in SED. For example, to create the "treeview2" data for eth0:

ifconfig|sed -n '/eth0/,/Interrupt/p'|sed -e 's/eth0//' -e 's/^[[:space:]]*//'
 
Old 09-30-2008, 08:09 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by swift2008 View Post
thats what am saying.
any way to direct dump in to gtktreeview.

dont have to use file concept.
Is gtktreeview a program that accepts input? If so, then you would do:

ifconfig|<processing>|gtktreview

where <processing> is something like my other post.
 
  


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
Ifconfig command Gins Linux - General 6 07-22-2008 07:16 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
IFConfig command dvong3 Linux - Networking 5 01-07-2004 07:44 AM
ifconfig command shoot2kill Linux - Networking 10 10-22-2003 12:50 PM
ifconfig command for SuSE 7.2 ucb-guy Linux - Networking 2 05-03-2002 08:57 PM

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

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