Tag Archives: $’\r’: command not found

When Linux runs SHELL file, $’\ R’: command not found appears

When running the written shell script, the error prompt $'\ \ R': command not found appears

The reason for the error is that when we operate in Windows system, the newline character in the editor is \\\\\\\\\\\\\\\\\

There are two ways to deal with it

1. VI command to enter the file to be edited, press ESC key to enter the command mode, execute the following command, press enter key, and then save to exit the file

: set ff=unix

2. The second kind

yum -y install dos2unix
dos2nuix install.sh

The above install. SH is the script you wrote. Use dos2nuix to process the files