[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Shell Script
From: |
Thobias Salazar Trevisan |
Subject: |
Re: [shell-script] Shell Script |
Date: |
Mon, 12 May 2003 10:11:57 -0300 (BRT) |
ae vitor,
On Mon, 12 May 2003, Vitor Alexandre S. Marinho wrote:
> Linux_01:/proc# cat meminfo
> total: used: free: shared: buffers: cached:
> Mem: 29511680 28192768 1318912 10551296 17559552 5042176
> Swap: 0 0 0
> MemTotal: 28820 kB
> MemFree: 1288 kB
> MemShared: 10304 kB
> Buffers: 17148 kB
> Cached: 4924 kB
> SwapTotal: 0 kB
> SwapFree: 0 kB
>
> Eu gostaria de obter o valor 29511680
este sed deve resolver o problema.
$ cat /proc/meminfo | sed -n 's,^Mem: *\([0-9]\+\).*,\1,p'
262975488
O -n fala para o sed não imprimir nada que nós não mandarmos.
depois na linha que queremos, que começa com Mem:,
pegamos só o campo que você quer e imprimimos o resultado.
falow
thobias
-------
echo 9446046325380026818553633794429812592304650P | dc
-------
http://www.lcp.coppe.ufrj.br/~thobias
____________________________
|
| Against - HTML Mail
| Against - MS ATTACHMENTS
|
----------------------------
- Shell Script, Vitor Alexandre S. Marinho, 2003/05/12
- Re: [shell-script] Shell Script,
Thobias Salazar Trevisan <=