scripts/copy-files.sh

20 lines
346 B
Bash

#!/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"