Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Replace bc with shell arithmetic - 2.0 #8949

Merged
merged 3 commits into from
Apr 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/helpers/general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function set_system_vars() {
export OS_MAJ=$(echo "${OS_VER}" | cut -d'.' -f1)
export OS_MIN=$(echo "${OS_VER}" | cut -d'.' -f2)
export OS_PATCH=$(echo "${OS_VER}" | cut -d'.' -f3)
export MEM_GIG=$(bc <<< "($(sysctl -in hw.memsize) / 1024000000)")
export MEM_GIG=$(($(sysctl -in hw.memsize) / 1024 / 1024 /1024))
export DISK_INSTALL=$(df -h . | tail -1 | tr -s ' ' | cut -d\ -f1 || cut -d' ' -f1)
export blksize=$(df . | head -1 | awk '{print $2}' | cut -d- -f1)
export gbfactor=$(( 1073741824 / blksize ))
Expand Down Expand Up @@ -379,4 +379,4 @@ function ensure-apt-packages() {
echo ""
fi
IFS=$OLDIFS
}
}