diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2019-01-29 16:46:15 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2019-01-29 16:46:15 +0100 |
commit | af046f01f8350f1bc9e585656cb56f3508a65d7f (patch) | |
tree | 329a04f664fd362440097ccb5bc22b8e941c529d | |
parent | fda41e399edf12c65b177ffbb98bc511b8f6463a (diff) |
Make getting the size platform dependent
-rwxr-xr-x | makecolumns.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/makecolumns.sh b/makecolumns.sh index b73dffe..b15a2dd 100755 --- a/makecolumns.sh +++ b/makecolumns.sh | |||
@@ -82,7 +82,10 @@ do_processfile_version_3() { | |||
82 | } | 82 | } |
83 | 83 | ||
84 | size() { | 84 | size() { |
85 | stat -f %z `printf %0${filename_len}d "$1"` | 85 | case `uname -s` in |
86 | *BSD|Darwin) stat -f %z `printf %0${filename_len}d "$1"`;; | ||
87 | *) stat -c %s `printf %0${filename_len}d "$1"`;; | ||
88 | esac | ||
86 | } | 89 | } |
87 | 90 | ||
88 | get_dword() { | 91 | get_dword() { |