[Issue Fixed]-执行脚本时出现invalid option错误
在執行腳本時,出現了: invalid option 錯誤
最后在stackoveflow上找到了答案
You script probably has characters in it that you cannot see. Perhaps it was copy/pasted using the wrong character set translation or is in DOS format. In the case of the latter you can use the tofrodos or dos2unix package to correct.
In either case you could pull it up in ‘vi’ or another application which will usually show weird characters like ^@ or ^M. You could try cat -v filename which might help see these oddities. Push comes to shove try hexdump (or hd, or od).
原來是因為使用window 復制黏貼該文件時,文件的格式發生了變化。
解決方案:在ubuntu上使用dos2unix命令去除格式即可
總結
以上是生活随笔為你收集整理的[Issue Fixed]-执行脚本时出现invalid option错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在ubuntu20.10上搭建SVN S
- 下一篇: [How TO]-windows安装wg