在windows下写一个更改discuz目录权限的脚本,结果总是用不成,执行时报错如下:
chmod: cannot access `data/attachment\r': No such file or directory
chmod: cannot access `data/attachment/album\r': No such file or directory
chmod: cannot access `data/attachment/forum\r': No such file or directory
chmod: cannot access `data/attachment/group\r': No such file or directory
chmod: cannot access `data/log\r': No such file or directory
chmod: cannot access `uc_client/data/cache\r': No such file or directory
chmod: cannot access `uc_server/data/\r': No such file or directory
chmod: cannot access `uc_server/data/cache\r': No such file or directory
chmod: cannot access `uc_server/data/avatar\r': No such file or directory
可以看到行尾多了 \r,百度了下说是换行符,看来要将文档转换为Unix格式的。
首先直接用Notepad++转换:
可是转换完成之后却出现了乱码,不知道是什么原因。
无奈转向VIM,设定文档格式为Unix:
然后脚本就可以执行了。
发表回复