This kind of problem often occurs when using different systems or machines to write or modify scripts. The inconsistency of newline characters leads to this problem
Solution: Explanation:
remove training sed -i 's/\r$//' filename
Option -i is for in-place editing, we delete the trailing \r directly in the input file. Thus be careful to type the pattern correctly.
Read More:
- Solution to the error $’\ R’: command not found when executing shell script under Linux
- Error BC: command not found when git bash runs shell script
- Shell script running error bash: JPS: command not found
- Command not found: ADB appears on Mac
- WCF-HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served…
- On the error report after the command of ADB shell error:device not A solution of found
- [solved] – bash: rabbitmq plugins: command not found or RA bbitmqctl:command not found
- Shell script syntax error near unexpected token ‘$’Do
- The shell script exits after an error is reported
- An undetermined call to function ‘shell’: missing ‘. Stop. Problem encountered when using shell command in makefile
- Solution to shell script error “expr: syntax error”
- Several methods of executing multiple commands in Linux shell
- Error: not found: python2 when executing NPM install
- Solve the problem of shell script “syntax error near unexpected token `fi’”.
- Linux basic command execution error: the solution of command not found
- If elif writing method of shell script
- $‘\r‘: command not found
- Shell script execution error: “syntax error near unexpected token”
- Shell script – EQ – Ne – GT – LT – ge – le
- Shell script: syntax error: bad for loop variable error resolution