depot/third_party/nixpkgs/pkgs/os-specific/bsd/xargs-j.sh

18 lines
223 B
Bash
Raw Normal View History

#! @shell@
declare -a args=()
token=$1
shift
while (( $# )); do
if [[ "$1" = "$token" ]]; then
mapfile -t -O $(("${#args[@]}" + 1)) args
else
args+=("$1")
fi
shift
done
exec "${args[@]}"