stat 398 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. declare -a opts
  5. while [[ "$1" ]]; do
  6. case "$1" in
  7. -c) shift ;;
  8. -f) shift ;;
  9. *) opts+=("$1") ;;
  10. esac
  11. shift
  12. done
  13. if /usr/bin/stat -qs .>/dev/null 2>&1; then
  14. /usr/bin/stat -f %z "${opts[@]}"
  15. else
  16. /usr/bin/stat -c %s "${opts[@]}"
  17. fi