From 9ed1cb8c9903ac393eab547db5989b4d569a8686 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 3 Apr 2024 22:36:51 -0400 Subject: [PATCH] make find | xargs invocations safer --- scripts/xhtmlize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/xhtmlize.sh b/scripts/xhtmlize.sh index 5a40078..4cc6932 100644 --- a/scripts/xhtmlize.sh +++ b/scripts/xhtmlize.sh @@ -27,5 +27,5 @@ trap cleanup EXIT export XMLLINT_INDENT=' ' export OUTPUT_DIR="$output_dir" -find "$output_dir" -type f -name '*.html' | xargs -n1 sh "$script_dir/xhtmlize-single-file.sh" -find "$output_dir" -type f -name '*.xml' | xargs -I_ xmllint --noblanks --encode UTF-8 --noent _ --output _ +find "$output_dir" -type f -name '*.html' -print0 | xargs -0 -n1 sh "$script_dir/xhtmlize-single-file.sh" +find "$output_dir" -type f -name '*.xml' -print0 | xargs -0 -I_ xmllint --noblanks --encode UTF-8 --noent _ --output _