Skip to content
Snippets Groups Projects
Commit cc57f3e9 authored by jonahbeneb02's avatar jonahbeneb02
Browse files

fucopy: Allow multiple patterns

parent ed670e16
No related branches found
No related tags found
1 merge request!4fucopy: Allow multiple patterns
#! /bin/sh
if [ $# -ne 1 ] || [ ! -f 'grades.csv' ]; then
if [ $# -lt 1 ] || [ ! -f 'grades.csv' ]; then
printf "Usage: %s <pattern>\n" $(basename $0) >&2
printf "Supply a pattern matching files to be copied, e.g. '*.pdf'\n" >&2
printf "Execute within the directory containing 'grades.csv'\n" >&2
exit 1
fi
pattern=$1
patterns=$@
find \
-wholename "*/Submission attachment(s)/$pattern" \
-execdir cp {} '../Feedback Attachment(s)' \;
for pattern in $patterns; do
find \
-wholename "*/Submission attachment(s)/$pattern" \
-execdir cp {} '../Feedback Attachment(s)' \;
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment