2017-12-28 21:50:31 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
check_command() {
|
2019-09-30 19:38:40 +00:00
|
|
|
command -v "$1" >/dev/null
|
2017-12-28 21:50:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if check_command gnustat; then
|
|
|
|
gnustat -c%s "$@"
|
|
|
|
elif check_command gstat; then
|
|
|
|
gstat -c%s "$@"
|
|
|
|
elif check_command stat; then
|
|
|
|
stat -c%s "$@"
|
|
|
|
else
|
|
|
|
echo "$0: no suitable stat implementation was found" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|