我正在编写一个文件脚本,该文件一旦运行就会更改文件的权限。我一直在Cygwin终端上得到这些错误:
$ chmx.bash
/home/user/scripts/chmx.bash: line 2: $'\r': command not found
/home/user/scripts/chmx.bash: line 4: $'\r': command not found
chmod: cannot access ‘chmxtext.txt\r\r’: No such file or directory
这是我的剧本:
#!/bin/bash
fileName="chmxtext.txt"
chmod a+rwx "$fileName"