I have these 2 line in my aaa.sh file:
#!/bin/bash
chmod +x /home/tot/*.html
When I run it on AWS EC2 Linux:
$ sh aaa.sh
I got this message:
chmod: cannot access ‘\r’: No such file or directory
I have these 2 line in my aaa.sh file:
#!/bin/bash
chmod +x /home/tot/*.html
When I run it on AWS EC2 Linux:
$ sh aaa.sh
I got this message:
chmod: cannot access ‘\r’: No such file or directory
You have Windows line endings in your file (\r\n). It needs to have Unix-style line endings (\n only).
You can do the conversion with the common dos2unix utility, or the set ff=unix command in vim.
chmod shouldn't care about the contents of your files. I bet you have a file with a control character in the filename itself. Might display as a question mark, but ls -b *.html should show you the culprit. Are your sure you want executable html files?