blackbox_shred_all_files: BUGFIX: Does not shred files with spaces.

This commit is contained in:
tlimoncelli@stackoverflow.com
2017-05-13 11:12:05 -04:00
committed by Tom Limoncelli
parent 5767f22445
commit 836657ebdf

View File

@@ -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.'