aboutsummaryrefslogtreecommitdiff
path: root/modules/ram
blob: d4a0a3673d083288b0a52bd1253e819d00b05ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# Prints the total ram and used ram in Mb

PREFIX=' '

get_ram()
{
    TOTAL_RAM=$(free -m | awk  {'print $2'} | head -n 2 | tail -1)
    FREE_RAM=$(free -m | awk  {'print $3'} | head -n 2 | tail -1)
    MB="MB"

    echo "$PREFIX$FREE_RAM/$TOTAL_RAM$MB"
}

get_ram