02-dos2unix命令与windows编辑shell不可执行问题

windows下写了一个shell脚本

02-dos2unix命令与windows编辑shell不可执行问题

在linux下执行

02-dos2unix命令与windows编辑shell不可执行问题

怀疑有奇怪的字符,使用cat -A 你的shell脚本,试试

02-dos2unix命令与windows编辑shell不可执行问题

好像有特殊字符

执行dos2unix relation.sh 试试

02-dos2unix命令与windows编辑shell不可执行问题

看起来没什么变化,我们在linux下执行脚本试试,结果可以

总结:写shell尽量在linux环境下