-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_popcon_entries.sh
More file actions
executable file
·44 lines (40 loc) · 1.03 KB
/
send_popcon_entries.sh
File metadata and controls
executable file
·44 lines (40 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
if [ "$#" -ne 2 ]; then
echo "Usage $0 [actual_submissions_folder] [destiny_submissions_folder]"
exit 1
fi
if ! [ -e "$1" ]; then
echo "$1 not found"
echo ""
echo "Usage $0 [actual_submissions_folder] [destiny_submissions_folder]"
exit 1
fi
if ! [ -d "$1" ]; then
echo "$1 not a directory"
echo ""
echo "Usage $0 [actual_submissions_folder] [destiny_submissions_folder]"
exit 1
fi
if ! [ -e "$2" ]; then
echo "$2 not found"
echo ""
echo "Usage $0 [actual_submissions_folder] [destiny_submissions_folder]"
exit 1
fi
if ! [ -d "$2" ]; then
echo "$2 not a directory"
echo ""
echo "Usage $0 [actual_submissions_folder] [destiny_submissions_folder]"
exit 1
fi
ACTUAL_SUBMISSIONS_FOLDER=$1
DESTINY_SUBMISSIONS_FOLDER=$2
for popcon_file in "$ACTUAL_SUBMISSIONS_FOLDER"/*popcon
do
dir_name=$(basename "$popcon_file")
dir_name=${dir_name:0:2}
dir_name=$DESTINY_SUBMISSIONS_FOLDER$dir_name
if [ ! -d "$dir_name" ]; then
mkdir $dir_name
fi
cp $popcon_file $dir_name
done