From 9c6f13fb8071548b6bd8789a61a9053cec571b95 Mon Sep 17 00:00:00 2001 From: "tlimoncelli@stackoverflow.com" Date: Sat, 13 May 2017 11:12:05 -0400 Subject: [PATCH] blackbox_shred_all_files: BUGFIX: Does not shred files with spaces. --- bin/blackbox_shred_all_files | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/blackbox_shred_all_files b/bin/blackbox_shred_all_files index 07bb56e..c0c9afb 100755 --- a/bin/blackbox_shred_all_files +++ b/bin/blackbox_shred_all_files @@ -24,11 +24,12 @@ echo '========== FILES BEING SHREDDED:' exported_internal_shred_file() { source "$1/_blackbox_common.sh" - unencrypted_file=$(get_unencrypted_filename "$2") - encrypted_file=$(get_encrypted_filename "$unencrypted_file") + unencrypted_file="$2" if [[ -f "$unencrypted_file" ]]; then - echo " $unencrypted_file" + echo " SHRED: $unencrypted_file" shred_file "$unencrypted_file" + else + echo "NOT FOUND: $unencrypted_file" fi } @@ -38,6 +39,6 @@ DEREFERENCED_BIN_DIR="${0%/*}" MAX_PARALLEL_SHRED=10 export IFS= -xargs -I{} -n 1 -P $MAX_PARALLEL_SHRED bash -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR {}" $DEREFERENCED_BIN_DIR/fake <"$BB_FILES" +tr '\n' '\0' <"$BB_FILES" | xargs -0 -I{} -n 1 -P $MAX_PARALLEL_SHRED bash -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR \"{}\"" $DEREFERENCED_BIN_DIR/fake echo '========== DONE.'