View previous topic :: View next topic |
Author |
Message |
hakker82 Apprentice
Joined: 13 Jul 2004 Posts: 188
|
Posted: Mon Nov 15, 2004 4:29 pm Post subject: welches Programm beherrscht reguläre Ausrdücke? [solved] |
|
|
ich möchte gerne aus der Ausgabe von acpi -b (Battery 1: charged, 51%)
nur die 51% heraushaben. Welches Programm kann so etwas?
Wie funktioniert es.
Grep kann reguläre Ausdrücke, filtert aber nichts heraus.
Thx
Last edited by hakker82 on Mon Nov 15, 2004 5:17 pm; edited 1 time in total |
|
Back to top |
|
|
sven-tek Guru
Joined: 06 May 2003 Posts: 339
|
Posted: Mon Nov 15, 2004 5:10 pm Post subject: |
|
|
nimm sed dafür,
das müsste irgendwie so aussehen: acpi -b |sed -e 's/.*\([0-9][0-9]%\).*/\1/g' |
|
Back to top |
|
|
Haldir Guru
Joined: 27 Sep 2002 Posts: 546
|
Posted: Mon Nov 15, 2004 5:11 pm Post subject: |
|
|
du suchst nach awk
irgendwas im dreh von acpi -b | awk '{print $3;}'
Mit der Nummer hinter print kannst festlegen was du ausgeben willst
Last edited by Haldir on Mon Nov 15, 2004 5:17 pm; edited 1 time in total |
|
Back to top |
|
|
chrib Guru
Joined: 27 Sep 2003 Posts: 558 Location: Berlin, Germany
|
Posted: Mon Nov 15, 2004 5:13 pm Post subject: |
|
|
Man könnte natürlich auch mit Kanonen auf Spatzen schiessen und Perl nehmen.
Gruß
Christian _________________ Der Mensch kämpft um zu überleben, und nicht, um zu Grunde zu gehen. - Paulo Coelho
It is the end of all hope. To lose the child, the faith. To end all the innocence. To be someone like me. - Nightwish - End of all hope |
|
Back to top |
|
|
hakker82 Apprentice
Joined: 13 Jul 2004 Posts: 188
|
Posted: Mon Nov 15, 2004 5:16 pm Post subject: |
|
|
Das mit sed ging
Danke
werde mal sed und awk genauer anschauen |
|
Back to top |
|
|
psyqil Advocate
Joined: 26 May 2003 Posts: 2767
|
|
Back to top |
|
|
|