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

fucopy: Allow multiple patterns

parent ed670e16
Branches
No related tags found
1 merge request!4fucopy: Allow multiple patterns
#! /bin/sh #! /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 "Usage: %s <pattern>\n" $(basename $0) >&2
printf "Supply a pattern matching files to be copied, e.g. '*.pdf'\n" >&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 printf "Execute within the directory containing 'grades.csv'\n" >&2
exit 1 exit 1
fi fi
pattern=$1 patterns=$@
find \ for pattern in $patterns; do
-wholename "*/Submission attachment(s)/$pattern" \ find \
-execdir cp {} '../Feedback Attachment(s)' \; -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