Fix unrestrict issue

This commit is contained in:
Ben Sarmiento
2023-11-28 00:41:15 +01:00
parent c8334ecb3b
commit 3d380e468f
9 changed files with 131 additions and 68 deletions

View File

@@ -1,14 +1,12 @@
#!/bin/bash
process_file() {
echo "Processing $1"
# echo -n "First 100 bytes of $file: "
# | od -An -t x1
# dd bs=1 count=100 if="$file" 2>/dev/null
mock_scanner() {
echo "Processing $1..."
dd bs=1 count=100 if="$1" >/dev/null 2>&1
echo "Processed $1"
}
export -f process_file
export -f mock_scanner
if [ "$#" -ne 1 ]; then
echo "Usage: $0 directory"
@@ -20,4 +18,4 @@ if [ ! -d "$1" ]; then
exit 1
fi
find "$1" -type f -print0 | xargs -0 -n1 -P20 -I{} bash -c 'process_file "$@"' _ {}
find "$1" -type f -print0 | xargs -0 -n1 -P20 -I{} bash -c 'mock_scanner "$@"' _ {}