diff --git a/src/ci/scripts/free-disk-space.sh b/src/ci/scripts/free-disk-space.sh index 706ccaeb67f4e..50be23602fa5e 100755 --- a/src/ci/scripts/free-disk-space.sh +++ b/src/ci/scripts/free-disk-space.sh @@ -23,11 +23,10 @@ printSeparationLine() { # macro to compute available space # REF: https://unix.stackexchange.com/a/42049/60849 # REF: https://stackoverflow.com/a/450821/408734 -getAvailableSpace() { df -a "$1" | awk 'NR > 1 {avail+=$4} END {print avail}'; } - +getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); } # macro to make Kb human readable (assume the input is Kb) # REF: https://unix.stackexchange.com/a/44087/60849 -formatByteCount() { numfmt --to=iec-i --suffix=B --padding=7 "$1"'000'; } +formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); } # macro to output saved space printSavedSpace() {