From 84082d85b0479b57636a4462112e8b4558afdfe7 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 29 Apr 2021 13:39:05 +0200 Subject: [PATCH] Add script to copy files --- copy-files.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 copy-files.sh diff --git a/copy-files.sh b/copy-files.sh new file mode 100644 index 0000000..53e8d51 --- /dev/null +++ b/copy-files.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +usage() { + echo "Usage: copy-files.sh " + echo ": file that contains the files to copy, each on a different line" + echo ": 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"