Add support for busybox stat by just using the GNU stat option format no matter what, as Alpine doesn't ship BSD stat anyway. --- a/afl-cmin +++ b/afl-cmin @@ -347,15 +347,8 @@ # get list of input filenames sorted by size i = 0 - # yuck, gnu stat is option incompatible to bsd stat - # we use a heuristic to differentiate between - # GNU stat and other stats - "stat --version 2>/dev/null" | getline statversion - if (statversion ~ /GNU coreutils/) { - stat_format = "-c '%s %n'" # GNU - } else { - stat_format = "-f '%z %N'" # *BSD, MacOS - } + # Both GNU stat and busybox stat use -c for the format + stat_format = "-c '%s %n'" # GNU, busybox cmdline = "(cd "in_dir" && find . \\( ! -name \".*\" -a -type d \\) -o -type f -exec stat "stat_format" \\{\\} + | sort -k1n -k2r)" #cmdline = "ls "in_dir" | (cd "in_dir" && xargs stat "stat_format" 2>/dev/null) | sort -k1n -k2r" #cmdline = "(cd "in_dir" && stat "stat_format" *) | sort -k1n -k2r"