***.sh: 2: set: Illegal option - 终端运行.sh报错:***.sh: 2: set: Illegal option -solution:Remove trailing \r character that causes this error:command 终端运行.sh报错:***.sh: 2: set: Illegal option - solution:Remove trailing \r character that causes this error: command sed -i 's/\r$//' filename 参考: https://stackoverflow.com/questions/11616835/r-command-not-found-bashrc-bash-profile/11617204#11617204 –竹儿