-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadAllFilePath.sh
executable file
·92 lines (92 loc) · 1.26 KB
/
readAllFilePath.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
# parentdir = ../en.docs.2011/
cd ..
cd en.docs.2011/
# pwd
flag=0
fl=0
i=0
loop=-1
export foo="hi"
path=()
for d in `ls`;
do
#var s = "../en.docs.2011/" + "$d"
# echo $d
loop=$((loop+1))
if [ $flag -eq 1 ];
then
if [ $fl -eq 1 ];
then
cd ..
fl=2
fi
cd ..
# pwd
fi
flag=1
cd $d
for subdir in `ls`;
do
if [ $fl -eq 1 ];
then
cd ..
fi
# echo $subdir
# if [ -d "$subdir" ]; then
# Control will enter here if $DIRECTORY exists.
fl=1
# echo $subdir
if [ $tele -eq 1 ]; then
cd ..
fi
tele=0
cd $subdir
if [ $loop -eq 1 ]; then
for a in `ls`;
do
if [[ "$a" == *utf8 ]]; then
# echo "yes"
cd $a
for q in `ls`;
do
cd $q
s=`pwd`
path[$i]=$s
i=$((i+1))
cd ..
done
cd ..
else
pwd
# echo $a
if [ $tele -eq 1 ]; then
cd ..
fi
tele=1
cd $a
s=`pwd`
path[$i]=$s
i=$((i+1))
fi
done
else
s=`pwd`
path[$i]=$s
# echo $s
i=$((i+1))
fi
done
# echo "${path[@]}"
done
# echo "${path[@]}"
# declare -a joined;
# joined=( $(./english_Index.py "${path[@]}" ) );
cd ..
cd ..
cd ..
if [ $tele -eq 1 ]; then
cd ..
fi
cd FinalIR
python3 english_Index.py "${path[@]}"