Explain the function of static keyword and final keyword in Java in detail>>>
Problem description
A small shell script written a few days ago was used to test the automatic installation of MySQL. Today’s test runs, and then the following error appears:
$’\ R’: command not found
Problem analysis
Check the script, no problem, just empty lines. It is suggested that this error is not the code itself. It is suspected that it may be the coding format error. The script is edited under Linux to complete the test. Later, I made a simple modification, which was completed in the window, and then uploaded to the Linux server
note: the newline in win is carriage return + newline, that is, the newline in UNIX
Linux does not recognize “R” as carriage return character. If the script has carriage return character, it will cause problems in the execution of script coding
Dealing with problems
execute the dos2unix script name on Linux, and execute the script after conversion
Check the SH file for garbled code
cat -Amysql_ install_ binary5.6.16.sh
prompt to install without dos2unix command
[ root@localhost soft]# dos2unix mysql_ install_ binary5.6.16.sh
bash: dos2unix: command not found…
[ root@localhost soft]# yum -y install dos2unix
Execute dos2unix script name on Linux,
[ root@localhost soft]# dos2unix mysql_ install_ binary5.6.16.sh
dos2unix: converting file mysql_ install_ binary5.6.16.sh to Unix format …
and then execute the script
After the script is executed, MySQL goes directly to the login interface. Done
In learning, try to develop good habits slowly, code, test and update under Linux, etc
End
I’d like to share with you the problems in my work and study, hoping to be helpful to you
Reproduced in: https://blog.51cto.com/it3246/2097318
Similar Posts:
- Shell script error newline syntax error near unexpected token
- shell :syntax error: unexpected end of file
- [Solved] Expected linebreaks to be ‘LF’ but found ‘CRLF’.
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- When Linux runs SHELL file, $’\ R’: command not found appears
- One line command / usr / bin / Perl ^ m: bad interpreter
- shell :syntax error: unexpected end of file
- The solution of job failed to start when modifying MySQL character encoding
- Git Warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LF
- syntax error near unexpected token `do [How to Solve]