In shell script how can i compare these kind of variable
echo $du //170G
echo $expected_du // 40G
if [ $expected_du -le $du ]
then
echo "$du exceeded";
fi
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
-kflag todu, which returns the size in kilobytes without any units. For example:Now you have a number that you can compare using
-le.You could also multiple things out in your script: