forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstr-search.sh
More file actions
39 lines (32 loc) · 730 Bytes
/
str-search.sh
File metadata and controls
39 lines (32 loc) · 730 Bytes
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
if [ -f search-str.result ];
then
echo "remove search-str.result"
rm search-str.result
fi
if [ -f file-sys.result ];
then
echo "remove file-sys.result"
rm file-sys.result
fi
find . > file-sys.result
echo "build new search-str.result..."
while read line
do
#echo $line
if [ -d $line ];
then
continue
fi
#echo $line
result=$(cat $line | grep -n $1)
#echo $result
if [ "$result" = "" ];
then
continue
else
echo "============= $line ================="
echo "============= $line =================" >> search-str.result
cat $line | grep -n --color=auto $1
cat $line | grep -n --color=auto $1 >> search-str.result
fi
done < file-sys.result