Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- #Bash Template
- tram=0
- uram=0
- fram=0
- gb="Gb"
- echo -e "Ram:"
- echo -e "Total " "Used " "Free"
- ram1=$(free | awk '/^Mem:/{print $2}')
- tram=$(echo "scale=2; $ram1 /1024/1024" | bc)
- ram2=$(free | awk '/^Mem:/{print $3}')
- uram=$(echo "scale=2; $ram2 /1024/1024" | bc)
- ram3=$(free | awk '/^Mem:/{print $4}')
- fram=$(echo "scale=2; $ram3 /1024/1024" | bc)
- echo "$tram$gb" "$uram$gb" "$fram$gb"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement