Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] Skripthilfe - 'sed' [solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
alekel
Tux's lil' helper
Tux's lil' helper


Joined: 05 Apr 2004
Posts: 99
Location: Kamen / NRW

PostPosted: Fri Jul 23, 2004 3:26 pm    Post subject: [OT] Skripthilfe - 'sed' [solved] Reply with quote

Hallo,

ich habe ein kleines Problem zu lösen. Ich möchte die CPU-Info von meinem Rechner auslesen.

Code:
cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //'


Das funktioniert auch soweit. Da es sich aber um einen P4 mit Hyper Threading handelt liefert er mir die Ausgabe zweimal, also:

Code:
Intel(R) Pentium(R) 4 CPU 3.40GHz
Intel(R) Pentium(R) 4 CPU 3.40GHz


gibt es eine Möglichkeit diese Ausgabe nur einfach darzustellen? Es muss auch nicht mit dem sed sein. :lol:

Sorry, aber mit dem skripten steh ich noch ganz am anfang. :oops:


Last edited by alekel on Sat Jul 24, 2004 6:42 am; edited 1 time in total
Back to top
View user's profile Send private message
Haldir
Guru
Guru


Joined: 27 Sep 2002
Posts: 546

PostPosted: Fri Jul 23, 2004 3:40 pm    Post subject: Reply with quote

man grep is dein Freund, insbesondere die -m option
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Fri Jul 23, 2004 3:53 pm    Post subject: Reply with quote

Code:

... | head -n 1
... | tail - n 1
Back to top
View user's profile Send private message
Silicoid
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2004
Posts: 144
Location: Erde

PostPosted: Fri Jul 23, 2004 4:11 pm    Post subject: Reply with quote

Code:

...| uniq
Back to top
View user's profile Send private message
alekel
Tux's lil' helper
Tux's lil' helper


Joined: 05 Apr 2004
Posts: 99
Location: Kamen / NRW

PostPosted: Sat Jul 24, 2004 6:41 am    Post subject: Reply with quote

danke funktioniert alles.....

ich bin schon fast an der Regular Expressions verzweifelt..... :? :P :lol: aber Übung macht den Meister (das dauert bestimmt noch ne weile).

Danke nochmal
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum