小编use*_*418的帖子

unix中循环外变量的值

请我尝试了很多选项,但我不知道如何使用循环外的值,

c='0'   
find $file -type f -maxdepth 1 -iname '*.R' -print0 | while read -d '' file; do

    c=$(($c + $(wc -l < $file) )) 

done 
echo $c
Run Code Online (Sandbox Code Playgroud)

非常感谢

unix bash

1
推荐指数
1
解决办法
412
查看次数

标签 统计

bash ×1

unix ×1