We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4e4100 commit eb0f78fCopy full SHA for eb0f78f
stow/shell/dot-functions
@@ -85,7 +85,10 @@ function server() {
85
# Compare original and gzipped file size
86
function gz() {
87
local origsize gzipsize ratio
88
- origsize=$(wc -c <"${1}")
+ origsize=$(
89
+ stat -Lf"%z" -- "$1" 2> /dev/null; # macOS `stat`
90
+ stat -Lc"%s" -- "$1" 2> /dev/null; # GNU `stat`
91
+ );
92
gzipsize=$(gzip -c "${1}" | wc -c)
93
ratio=$(echo "${gzipsize} * 100 / ${origsize}" | bc -l)
94
printf "orig: %d bytes\n" "${origsize}"
0 commit comments