Syntax error near unexpected token `newline’script cannot be executed

Problem description
The run.sh script is executed to report an error with the following message:

/data/app/information-provider
: No such file or directory
: command not found
./run.sh: line 4: syntax error near unexpected token `newline'
'/run.sh: line 4: `case "$1" in  

Problem analysis
Look for the script. The script is fine, so I wonder if the file format is incorrect.
view the file with the following command,

cat -A run.sh

Find that in run.sh, the newline ends with ^M$

server="$( dirname "${BASH_SOURCE[0]}" )" && pwd ^M$
cd $server^M$
^M$
case "$1" in  ^M$
  ^M$
  ...

The solution
Execute the following statement to convert run.sh to a line break of $in the Linux environment

dos2unix run.sh

View the conversion file through Cat-a run.sh as:

server="$( dirname "${BASH_SOURCE[0]}" )" && pwd $
cd $server$
$
case "$1" in  $
  $

Read More: