diff --git a/lib/obp60task/Code_Size.sh b/lib/obp60task/Code_Size.sh new file mode 100644 index 0000000..7bff89c --- /dev/null +++ b/lib/obp60task/Code_Size.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +dir="$1" + +total=0 + +while IFS= read -r -d '' file; do + lines=$(wc -l < "$file") + echo "$file : $lines" + total=$((total + lines)) +done < <(find "$dir" \( -name "*.c" -o -name "*.cpp" -o -name "*.h" \) -type f -print0) + +echo "-----------------------" +echo "Over all files: $total" \ No newline at end of file