From: Junio C Hamano Date: Mon, 11 Jul 2005 21:59:58 GMT Subject: Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update Message-ID: <7vmzotovfl.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <42D2E47E.8060602@yahoo.com> Bryan Larsen writes: > For the record, "${XARGS} -0r" may be uglier than "xargs -0r", but > replacing it with several lines of shell magic is a loss. OK, OK, the one I suggested for xargs was _U_G_L_Y_. The one Linus suggested looks to me the cleanest. That is, to give an extra parameter upfront to the command run by xargs. My favorite trick is like this: git-fsck-cache --cache --unreachable "$@" | sed -ne '/unreachable /{ s/unreachable [^ ][^ ]* // s|\(..\)|\1/|p }' | { cd "$GIT_OBJECT_DIRECTORY" || exit - xargs -r $dryrun rm -f + xargs $dryrun rm -f "" } Dry-run would say: rm -f 00/012345... rm -f 01/234567... without visual distraction of having printable phoney names, or just (with an invisible trailing space): rm -f During a real run, "rm -f" would not complain "cannot remove `': Is a directory", either.