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

Merge branch 'fucopy-multiple' into 'main'

fucopy: Allow multiple patterns

See merge request !4
parents ed670e16 cc57f3e9
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