每当我运行此脚本时,查找部分都会执行,但 if 语句会导致此错误:
./list_datasheets.csh: line 13: syntax error: unexpected end of file
这是脚本:
find $1 -type d | while read -r dir
do
for f in ${dir}/*
do
echo ${f} | tr '[A-Z]' '[a-z]'
done
done
if ($2 == "both") then
echo 'bye'
else
echo 'hi'
endif