Article Title: Practical Tips: convert a DOS file to a UNIX file format. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I have written a script file for MYSQL automatic backup over the past few days. I don't know why, I have never been able to run. I tried every sentence in every sentence, without syntax errors or logic errors.
However, it does not run and the following error is reported:
Or:
line 19 :syntax error near unexpected token 'fi' line 19: 'fi'
|
A netizen on the Internet said that when uploading files from WINDOWS to LINUX, there may be a format error, that is, the DOC format under WINDOWS, so I tried to change it to UNIX format.
The method is as follows:
Vi xxxx. sh: set fileformat = unix: wq or: dos2unix xxxx. sh
|