Advertisement
Void-voiD

Untitled

Dec 13th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. res=0
  4. all=0
  5. for i in $(find . -name "*.scm"); do
  6. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  7. res=`expr $res + 1`
  8. done
  9. echo "Scheme : number of files - $res ; number of strings in files : $all"
  10. res=0
  11. all=0
  12. for i in $(find . -name "*.c"); do
  13. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  14. res=`expr $res + 1`
  15. done
  16. echo "C : number of files - $res ; number of strings in files : $all"
  17. res=0
  18. all=0
  19. for i in $(find . -name "*.py"); do
  20. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  21. res=`expr $res + 1`
  22. done
  23. echo "Python : number of files - $res ; number of strings in files : $all"
  24. res=0
  25. all=0
  26. for i in $(find . -name "*.sh"); do
  27. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  28. res=`expr $res + 1`
  29. done
  30. echo "Bash : number of files - $res ; number of strings in files : $all"
  31. res=0
  32. all=0
  33. for i in $(find . -name "*.cs"); do
  34. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  35. res=`expr $res + 1`
  36. done
  37. echo "C# : number of files - $res ; number of strings in files : $all"
  38. res=0
  39. all=0
  40. for i in $(find . -name "*.cpp"); do
  41. all=`expr $all + $(sed '/^\s*$/d' $i | wc -l)`
  42. res=`expr $res + 1`
  43. done
  44. echo "C++ : number of files - $res ; number of strings in files : $all"
  45. #^ - начало строки
  46. #\s* - пробельные символы
  47. #$ - конец строки
  48. #d - удаление того, что в паттерне
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement