执行sh脚本提示cannot Execute Required File Not Found

自己找ChatGPT生成了一段mosdns的安装脚本, 然后用winscp创建文件之后, 执行提示

cannot execute: required file not found

stackexchange 上找到了问题所在

原因是windows上换行符的问题

1
2
apt install dot2unix
dos2unix a.sh

再次执行就正常了

Licensed under CC BY-NC-SA 4.0
记录平时瞎折腾遇到的各种问题, 方便查找
使用 Hugo 构建
主题 Stack 3.29.0Jimmy 设计