linux 脚本 提示语法错误,syntax error: unexpected word (expecting "do")
脚本代码如下:#!/bin/shechocdDataforvarinABC;doecho"varis$var"doneechocd..在linux中运行后提示:#sh./...
脚本代码如下:
#!/bin/sh
echo cd Data
for var in A B C ; do
echo "var is $var"
done
echo cd ..
在linux中运行后提示:
# sh ./sendfile.sh
cd Data
./sendfile.sh: line 3: syntax error: unexpected word (expecting "do")
找不到原因啊。求大侠支招!!! 展开
#!/bin/sh
echo cd Data
for var in A B C ; do
echo "var is $var"
done
echo cd ..
在linux中运行后提示:
# sh ./sendfile.sh
cd Data
./sendfile.sh: line 3: syntax error: unexpected word (expecting "do")
找不到原因啊。求大侠支招!!! 展开
1个回答
2023-06-26
展开全部
for var in A B C ;
do
echo "var is $var"
done
do
echo "var is $var"
done
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询