windows 编写shell 脚本转化成unix

https://unix.stackexchange.com/questions/154408/cant-cd-to-home-user-when-sourcing-a-script

I had this same problem and I fixed it by converting the EOL characters to UNIX format. An easy way to do it is:

  • Load the file into Notepad++
  • Select all of the text to be converted (Ctrl + A)
  • Edit > EOL Conversion > UNIX
  • Save the file

If already in UNIX format, select another format (Windows) and then back into UNIX