Anonymous user
Category:TXR: Difference between revisions
→Simple Query: Revised example: using built-in math that TXR now has.
(→Simple Query: [minor] Wording.) |
(→Simple Query: Revised example: using built-in math that TXR now has.) |
||
Line 52:
<lang txr>#!/usr/bin/txr -f
@(next "/proc/meminfo")
@(define num (n))@\
@(skip)▼
@(local numtok)@{numtok /[0-9]+/}@(bind n @(int-str numtok 10))@\
MemFree:@/ +/@FREE kB▼
@(gather)
@(skip)▼
Cached: @(num CACHED) kB
SwapFree:@/ +/@SWFRE kB▼
SwapTotal: @(num SWTOT) kB
@(next `!echo $(( @TOTAL - @FREE ))`)▼
@(next `!echo $(( @USED - @BUFS - @CACHED ))`)▼
@(
@(
@(output)
TOTAL USED FREE BUFFERS CACHED
|