Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to compare percentage value in shell script

size=$(df -kh | awk '$6 == "/var" {print $5}')
size=${size%"%"}
if (( size < 80 )); then
    echo "/var is less than 80 % full"
fi
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #compare #percentage #shell #script
ADD COMMENT
Topic
Name
9+2 =