2021-04-29 13:39:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
usage() {
|
2021-04-29 14:10:53 +02:00
|
|
|
echo "Usage: copy-files.sh <input directory> <output directory>"
|
|
|
|
echo "<input directory>: directory where the files are located"
|
2021-04-29 13:39:05 +02:00
|
|
|
echo "<output directory>: directory where the files are copied to"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# != 2 ]; then
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
2021-04-29 14:10:53 +02:00
|
|
|
input=$1
|
2021-04-29 13:39:05 +02:00
|
|
|
output=$2
|
|
|
|
|
2021-04-29 14:10:53 +02:00
|
|
|
find "$input" -type f -iregex '.*\.\(pdf\|doc\|docx\|xlsx\|accdb|\mdb\)' -print0 | xargs -0 cp -t "$output"
|