shell 脚本,在调试时,FOR循环那行代码,总是出现错误syntax error near unexpected token '$'\r''

代码是NUTCH 1.0的recrawl脚本已经指向bin/bash 附上出错的代码行
for((i=0;i<$depth;i++))
以及前后

echo "----- Generate, Fetch, Parse, Update (Step 2 of $steps) -----"
for((i=0;i<$depth;i++))
do
echo "--- Beginning crawl at depth `expr $i + 1` of $depth ---"
$NUTCH_HOME/bin/nutch generate crawl/crawldb crawl/segments $topN \
-adddays $adddays
if [ $? -ne 0 ]
then
echo "runbot: Stopping at depth $depth. No more URLs to fetch."
break
fi
segment=`ls -d crawl/segments/* | tail -1`
不能解决,错误提示是
bin/runbot:line 49:syntax error near unexpected token '$'\r''
'in/runbot:line 49: 'for((i=0;i<$depth;i++))

line 49代码就是for((i=0;i<$depth;i++))
换号符错误,还是句式上有什么问题

语法检查都试过 就是line 49这个错误 难道是我的cygwin跟WIN7 系统的问题

第1个回答  2011-02-18
1.for do done????
2.try echo $depth?
相似回答