When executing shell script, $’r ‘: command not found appears

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:
remove training sed -i 's/\r$//' filename

Explanation:
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: