计算机技术

解决shell脚本“syntax error near unexpected token `fi’”的问题。

执行shell脚本的时候,提示如下错误:

查询资料后发现:

执行:

1vi finddir.sh

然后,输入

1set ff

结果是:

解决方案就是,修改为unix:

1set ff=unix

执行保存命令:

1:wq

再次执行:

1:set ff

最后执行命令。

本文中有一处错误,那就是脚本中的

1if [-d "$folder"]; then

 改为:

1if [ ! -d "$folder" ]; then

https://www.cnblogs.com/zjiacun/p/8066841.html

Related Articles

发表回复

Check Also
Close
Back to top button