Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- memoria_total () {
- local num_1=$1
- local num_2=$2
- echo $(($num_1+$num_2))
- }
- # primer numero
- memoria_fisica=$(free | awk '/^Mem:/ {print $3}')
- # segundo numero
- memoria_intercambio=$(free | awk '/^Inter:/ {print $3}')
- # kilobytes
- resultado=$(suma_numeros $memoria_fisica $memoria_intercambio)
- # megabytes
- resultado=$((resultado/1024))
- echo "Memoria total utilizada (fisica y de intercambio): ${resultado}MB"
- cat /etc/* > /dev/null
- # primer numero
- memoria_fisica=$(free | awk '/^Mem:/ {print $3}')
- # segundo numero
- memoria_intercambio=$(free | awk '/^Inter:/ {print $3}')
- # kilobytes
- resultado=$(memoria_total $memoria_fisica $memoria_intercambio)
- # megabytes
- resultado=$((resultado/1024))
- echo "Memoria total utilizada (fisica y de intercambio): ${resultado}MB"
Advertisement
Add Comment
Please, Sign In to add comment