1 #!/bin/bash 2 for i in `grep CPU_ZERO ./ -nrw | awk -F: '{print $1}'` 3 do 4 echo $i 5 head -20 $i | grep "#include" 6 echo " " 7 8 done
如果还想统计头文件出现的次数,则:
./inc.sh | grep "<sched.h>" | wc -w
1 #!/bin/bash 2 for i in `grep CPU_ZERO ./ -nrw | awk -F: '{print $1}'` 3 do 4 echo $i 5 head -20 $i | grep "#include" 6 echo " " 7 8 done
如果还想统计头文件出现的次数,则:
./inc.sh | grep "<sched.h>" | wc -w
转载于:https://www.cnblogs.com/xxg1992/p/7388112.html