Changed all 'print' to 'printf'

This commit is contained in:
Dylan 2016-01-22 15:12:43 +11:00
parent 2301000a72
commit 7577752047
1 changed files with 5 additions and 5 deletions

10
fetch
View File

@ -709,7 +709,7 @@ getgpu () {
"Mac OS X")
gpu=$( \
system_profiler SPDisplaysDataType | \
awk -F': ' '/^\ *Chipset Model:/ {print $2}' | \
awk -F': ' '/^\ *Chipset Model:/ {printf $2}' | \
awk '{ printf "%s / ", $0 }'
)
gpu=${gpu//'/ $'}
@ -775,8 +775,8 @@ getmemory () {
"Mac OS X")
memtotal=$(printf "%s\n" "$(sysctl -n hw.memsize)"/1024^2 | bc)
memactive=$(vm_stat | awk '/active / { print $3 }')
memcompressed=$(vm_stat | awk '/occupied/ { print $5 }')
memactive=$(vm_stat | awk '/active / { printf $3 }')
memcompressed=$(vm_stat | awk '/occupied/ { printf $5 }')
memused=$(((${memactive//.} + ${memcompressed//.}) * 4 / 1024))
memory="${memused}MB / ${memtotal}MB"
;;
@ -788,7 +788,7 @@ getmemory () {
memtotal=${memtotal/\(/}
memtotal=${memtotal/MB\)/}
memfree=$(top -d 1 | awk '/Real:/ {print $6}')
memfree=$(top -d 1 | awk '/Real:/ {printf $6}')
memfree=${memfree/M/}
memused=$((memtotal - memfree))
@ -863,7 +863,7 @@ getresolution () {
"Mac OS X")
resolution=$(system_profiler SPDisplaysDataType |\
awk '/Resolution:/ {print $2"x"$4" "}')
awk '/Resolution:/ {printf $2"x"$4" "}')
;;
esac