请我尝试了很多选项,但我不知道如何使用循环外的值,
c='0' find $file -type f -maxdepth 1 -iname '*.R' -print0 | while read -d '' file; do c=$(($c + $(wc -l < $file) )) done echo $c
非常感谢
unix bash
bash ×1
unix ×1