[Linux-Biella] script di parsing
Claudio M.
linux@bilug.linux.it
Thu, 14 Feb 2002 16:22:46 +0100
On Thu, 14 Feb 2002 16:08:01 +0100
CIARROCCHI Paolo <Paolo.CIARROCCHI@omnitelvodafone.it> wrote:
> Ciao a tutti,
> devo fare uno script per estrarre alcune informazioni da un file simile a
> questo:
>
> memory 20
> 0.15user 0.11system 0:00.27elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
> 0inputs+0outputs (95major+10275minor)pagefaults 0swaps
> cat: /proc/comp_cache_stat: No such file or directory
Una expr regolare potrebbe essere
/^memory\s(\d+)$/ per il memory
/\s(\d+)%CPU/ per il CPU (non sono sicuro se il % viene accettao cosi' com'e')
E' ovviamente possibile raccogliere anche gli altri valori... in che linguaggio ti serve?
Bye
--
Per cortesia niente allegati word, solo in formato ASCII (.txt)
oppure Rich Text Format (.rtf)
--
Linux Registered User #151147 | Home Page http://www.bilug.linux.it
Linux registered Machine #66331 | ICQ Number 53293810
GPG key http://www.bilug.linux.it/~cmaffio/key-bilug.asc