Get the App
SLTechnology News&Howtos  ›  Servers  › 

Solaris syntax error: unexpected end of file

Shulou Source: shulou.com Published: 2022-06-02 05:14:15 10月06日 Update

Describe

Check_shareplex_health.sh: line 123: syntax error: unexpected end of file

Cause

Solaris system shell footer line 123line, that is, the last line of my script has an error, in fact, after checking, the last line of my script has no syntax errors. Generally, there are two reasons for this problem: (1) the windows editor edits the script in the format of dos, and the line feed at the end of the line is different from Unix, which causes this error. (2) the script uses EOF or similar custom command input, but there is no ceiling at the end of EOF, there is indentation, which will also cause this error.

Solution

My mistake is the second case, fix EOF, delete the space or tab in front of it, make it top, and the problem is solved. In the first case, you can use UE file-convert-dos to Unix conversion, or if the Linux platform has the dos2unix command installed, you can also use this command to convert the format.

Tags: Scripts errors commands one line situation format problems differences that is tabs reasons platforms newline characters files spaces systems editors syntax tabulation checks Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft OPPO Reno Shulou Tech Info Linux