Compare commits
1 Commits
f578383b63
...
bd880608c5
Author | SHA1 | Date |
---|---|---|
coolneng | bd880608c5 |
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: copy-files.sh <file> <output directory>"
|
echo "Usage: copy-files.sh <input directory> <output directory>"
|
||||||
echo "<file>: file that contains the files to copy, each on a different line"
|
echo "<input directory>: directory where the files are located"
|
||||||
echo "<output directory>: directory where the files are copied to"
|
echo "<output directory>: directory where the files are copied to"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,7 @@ if [ $# != 2 ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
filename=$1
|
input=$1
|
||||||
output=$2
|
output=$2
|
||||||
|
|
||||||
while read -r p; do
|
find "$input" -type f -iregex '.*\.\(pdf\|doc\|docx\|xlsx\|accdb|\mdb\)' -print0 | xargs -0 cp -t "$output"
|
||||||
cp "$p" "$output"
|
|
||||||
done <"$filename"
|
|
||||||
|
|
Loading…
Reference in New Issue