18 lines
391 B
Bash
18 lines
391 B
Bash
#!/bin/sh
|
|
|
|
usage() {
|
|
echo "Usage: copy-files.sh <input directory> <output directory>"
|
|
echo "<input directory>: directory where the files are located"
|
|
echo "<output directory>: directory where the files are copied to"
|
|
exit 1
|
|
}
|
|
|
|
if [ $# != 2 ]; then
|
|
usage
|
|
fi
|
|
|
|
input=$1
|
|
output=$2
|
|
|
|
find "$input" -type f -iregex '.*\.\(pdf\|doc\|docx\|xlsx\|accdb|\mdb\)' -print0 | xargs -0 cp -t "$output"
|