Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
计算指定目录中python代码的总行数,并作为Shell脚本执行_Shell - Fatal编程技术网

计算指定目录中python代码的总行数,并作为Shell脚本执行

计算指定目录中python代码的总行数,并作为Shell脚本执行,shell,Shell,如何计算目录中的代码行数,以及如何将其作为终端中的shell脚本执行 echo Please, enter file location as a sub-directory read LOCATION cd $LOCATION find . "(" -name "*.py" ")" -print0 | xargs -0 wc -l 您可以在终端中以脚本.sh的形式执行它tryfind。“(“-name”*.FILE_EXTENSION_HERE”或-name“*.other_FILE_EXTE

如何计算目录中的代码行数,以及如何将其作为终端中的shell脚本执行

echo Please, enter file location as a sub-directory
read LOCATION
cd $LOCATION
find . "(" -name "*.py" ")" -print0 | xargs -0 wc -l
您可以在终端中以脚本.sh的形式执行它

try
find。“(“-name”*.FILE_EXTENSION_HERE”或-name“*.other_FILE_EXTENSION_HERE”)”-print0 | xargs-0 wc-l