Fix unrestrict issue
This commit is contained in:
12
scan_test.sh
12
scan_test.sh
@@ -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 "$@"' _ {}
|
||||
|
||||
Reference in New Issue
Block a user