-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
65 lines (59 loc) · 883 Bytes
/
test.sh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
rm -rf frames
rm -rf slides
rm answer.txt
mkdir frames
mkdir slides
cd ~/DSAA_PROJECT/Data/Dataset
string=.jpg
declare -a slidearr
declare -a framearr
declare -a dirarr
declare -a donearr
CNT=0
for Dir in *
do
# echo $Dir
cd $Dir
for F in *
do
if [[ $F != answer.txt ]]
then
fgg=ppt.jpg
if [[ $F = $fgg ]]
then
echo -n ""
else
slidearr+=($CNT)
framearr+=($F)
dirarr+=($Dir)
donearr+=(0)
fi
fi
done
CNT=`expr $CNT + 1`
cd ..
done
C=0
Ci=0
for((i=1;i<=50;i++))
do
c=0
val=$RANDOM
val=$(($val % 400))
dg=$((val/4))
v=~/DSAA_PROJECT/Data/Dataset/
x=${framearr[$val]}
y=${dirarr[$val]}
sl=/
dot=~
d=frames
e=slides
po=${slidearr[$val]}
dr=ppt
cp $v$y$sl$x $dot$sl$d$sl$C$string
cp $v$y$sl$dr$string $dot$sl$e$sl$dr$po$string
echo $C$string $dr$po$string >> ~/answer.txt
C=`expr $C + 1`
done
echo $Ci