shell 脚本文件Windows传到Linux后编码问题                     

下面这个标红的位置出现,是由于脚本从Windows机器上直接传到linux文件格式不对导致的。
cat -v a.sh
help^M
exit^M
}^M
[ $# -ne ${parasnum} ] && help_msg^M
^M
export HOST_IP=$1^M
export HOST_PORT=$2^M
 
需要使用dos2unix命令处理脚本。
解决方法:dos2unix aa.sh  即可。

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-01-15
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案