This removes the restriction on the length of the command line, as xargs
will work around by running multiple instances of the command for us.
As seen: https://bbs.archlinux.org/viewtopic.php?pid=
1232959
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
# crush. kill. destroy.
(( verbose )) && cmdopts+=(-v)
if (( delete )); then
- runcmd rm "${cmdopts[@]}" "${candidates[@]}"
+ printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}"
elif (( move )); then
- runcmd mv "${cmdopts[@]}" "${candidates[@]}" "$movedir"
+ printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir"
fi
summarize "$pkgcount" "${candidates[@]}"