+ Reducing script word count

This commit is contained in:
ziro 2020-05-18 13:02:43 +07:00
parent 1bed6fc964
commit 1d2c406697
2 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,8 @@
capacity=$(df -h --output=source,avail /home | grep -A1 '/' | sed "s/^.* //;s/[[:alpha:]]//")
warn=""
if [ $capacity -lt 71 ]; then warn='!'; fi
[ $capacity -lt 21 ] && warn='!'
printf "%s%s" "$warn " "$(echo $capacity | sed "s/$/G free/")"