View previous topic :: View next topic |
Author |
Message |
alekel Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/The Matrix/movie_the_matrix_morpheus.gif)
Joined: 05 Apr 2004 Posts: 99 Location: Kamen / NRW
|
Posted: Fri Jul 23, 2004 3:26 pm Post subject: [OT] Skripthilfe - 'sed' [solved] |
|
|
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.
Sorry, aber mit dem skripten steh ich noch ganz am anfang. ![Embarassed :oops:](images/smiles/icon_redface.gif)
Last edited by alekel on Sat Jul 24, 2004 6:42 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Haldir Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 27 Sep 2002 Posts: 546
|
Posted: Fri Jul 23, 2004 3:40 pm Post subject: |
|
|
man grep is dein Freund, insbesondere die -m option |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
schmutzfinger Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/12992294553fc7612a902c7.jpg)
Joined: 26 Oct 2003 Posts: 1287 Location: Dresden/Germany
|
Posted: Fri Jul 23, 2004 3:53 pm Post subject: |
|
|
Code: |
... | head -n 1
... | tail - n 1
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Silicoid Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/165620267640fd881a5f095.jpg)
Joined: 20 Jul 2004 Posts: 144 Location: Erde
|
Posted: Fri Jul 23, 2004 4:11 pm Post subject: |
|
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
alekel Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/The Matrix/movie_the_matrix_morpheus.gif)
Joined: 05 Apr 2004 Posts: 99 Location: Kamen / NRW
|
Posted: Sat Jul 24, 2004 6:41 am Post subject: |
|
|
danke funktioniert alles.....
ich bin schon fast an der Regular Expressions verzweifelt..... aber Übung macht den Meister (das dauert bestimmt noch ne weile).
Danke nochmal |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|