#!/bin/sh
#
# srandom-order - run files in dir(recursively) in random order with command

set -eu

if test "$#" -eq 0; then
  echo "Usage: $(basename "$0") <program-args>" >&2
  exit 2
fi

find . -type f -print0 \
  | sort --random-sort --zero-terminated \
  | xargs -0 "$@"
