Add script to copy files

This commit is contained in:
coolneng 2021-04-29 13:39:05 +02:00
parent 7cd4c1171d
commit 84082d85b0
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 19 additions and 0 deletions

19
copy-files.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
usage() {
echo "Usage: copy-files.sh <file> <output directory>"
echo "<file>: file that contains the files to copy, each on a different line"
echo "<output directory>: directory where the files are copied to"
exit 1
}
if [ $# != 2 ]; then
usage
fi
filename=$1
output=$2
while read -r p; do
cp "$p" "$output"
done <"$filename"