As an aside, please don' t put destructive commands such as truncate in your. Next time, before asking human help, please pass your script online on http: / / www. net/ ( even if this particular error is not detected, because the shell think echo" Fin del script" ; is a unknown command. The primary problem is that your script has DOS/ Windows- style line endings ( carriage return followed by linefeed). bash expects unix- style line endings ( just linefeed), and interprets the carriage return as part of the command,. This error occurs often when you have mismatched structure - that is, you do not have matching double quotes, matching. ksh: line 25: syntax error : unexpected end of file. If you do a grep ( - A1: + 1 line context). I had the same error due to missing " fi" line. Make sure to omit syntax errors. bashrc is located in / etc/ skel/.
So just run the following command: cp / etc/ skel/. profile など、 bash が立ち上がる際に読み込まれるファイルの中身を よく読んでください。 エラーメッセージにあるように、 43行目が怪しいです。 unexpected end of file とエラーが出ているので、 閉じカッコが不足していたり、 if に. sh is with CRLF line terminators. run dos2unix file. then the problem will be fixed. You can install dos2unix in ubuntu with this: sudo apt- get install dos2unix. you are missing endif; at the end.