这个错误提示意味着在find命令中,路径应该在表达式之前。在这种情况下,可能是因为文件名中包含空格或其他特殊字符,需要将文件名用引号括起来,例如:find "$dir" -name "*.c"

#binbashif $# = 0 then echo Usage $0 Direcory exit 1fitest ! -d $1 && echo $1 is not a Directory! && exit 1dir=$1sum=0for i in find $dir -name cdo echo $i lines=wc -l $i sum=expr $sum + $lines

原文地址: https://www.cveoy.top/t/topic/eCpz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录