hello163commail 当前离线
列兵
DAIC 当前离线
中将
TOP
#!/bin/bash case "$2" in total) df -m|grep "$1"|awk '{print $2}' ;; used) df -m|grep "$1"|awk '{print $3}' ;; pused) df -m|grep "$1"|awk '{print $5}' ;; free) df -m|grep "$1"|awk '{print $4}' ;; pfree) df -m|grep "$1"|awk '{print $4/$2}' ;; esac复制代码
#!/bin/bash echo { echo ' "data":[' echo " " df -mP | awk 'NR>1{gsub(/\//,"\\/",$6);print " { \"{#FSNAME}\":\""$6"\", \"{#FSVALUE}\":\""$2"\"},"}' | sed '$s/,$//' echo " ]" echo }复制代码
评分人数
#!/bin/bash echo { echo ' "data":[' echo " " df -mP | awk 'NR>1{print " { \"{#FSNAME}\":\"\\"$6"\", \"{#FSVALUE}\":\""$2"\"},"}' echo " ]" echo }复制代码