-
Notifications
You must be signed in to change notification settings - Fork 0
/
folder_do.sh
48 lines (41 loc) · 897 Bytes
/
folder_do.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
#!/bin/bash
#遍历目录 执行命令
run_make()
{
#如果该目录下存在Makefile
if [ -f "Makefile" ];then
echo ""
echo ===================== FOUND ===================
pwd;
echo ===============================================
make clean;
fi
}
run_ls()
{
pwd;
#每目录 执行命令
#ls -l |awk '{if($5 > 10485760){print $5}}'
#ls -l |awk '{if($5 > 10485760){print "--",$9,$5}}'
vcs --numcaps 12 --columns 4 --height 160 --autoaspect --anonymous *
echo ""
}
myfunc()
{
cd $1;
#run_make;
run_ls;
for x in $(ls .)
do
if [ -d "$x" ];then
myfunc $x;
cd ..
fi
done
}
p=.
if [ $1 ];then
p=$1
fi
echo $p
myfunc $p