当前位置:网站首页>-bash: ./build.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
-bash: ./build.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
2022-07-26 10:50:00 【deparks】
今天在编译新项目SDK的时候碰到这个问题,特此记录一下。
首先我在windows系统里面下载的代码,我尝试在windows下面运行build.sh没什么问题,但由于工具链是linux的,我就把代码拷贝到linux下编译就出现了这个错误。
问题原因
在各操作系统下,文本文件所使用的换行符是不一样的。UNIX/Linux 使用的是 0x0A(LF),但 DOS/Windows 一直使用 0x0D0A(CRLF)作为换行符。Git提供了一个“换行符自动转换”功能。在下载和提交代码的时候,它会自动将换行符进行转换,所以就出现了这个问题。
解决方法
1.使用控制台修改,打开“Git Bash”,然后输入
git config --global core.autocrlf false
git config --global core.safecrlf true
2.修改~/.gitconfig文件,加入或修改下面的行
[core]
autocrlf = false
其他修改方法
sed -i 's/\r$//' xxx.sh
dos2unix xxx.sh
边栏推荐
- SCADA和三大工业控制系统PLC、DCS、FCS
- Linkedblockingqueue of novice source code
- The problem of formatting IAR sprintf floating point to 0.0 in UCOS assembly
- 菜鸟看源码之LinkedBlockingQueue
- [leetcode daily question 2021/8/31] 1109. Flight reservation statistics [medium] differential array
- Bash shell学习笔记(七)
- MySQL quick learning notes-2021-08-31
- 软件测试综述之软件测试的背景、实质、软件开发的过程
- Flutter报错 Incorrect use of ParentDataWidget When the exception was thrown, this was the stack:
- flutter 背景变灰效果,如何透明度,灰色蒙板遮罩
猜你喜欢

很多人都不清楚自己找的是Kanban软件还是看板软件

The problem of formatting IAR sprintf floating point to 0.0 in UCOS assembly

Flutter编译报错 version of NDK matched the requested version 21.0.6113669. Versions available locally: 2

菜鸟看源码之ArrayList

Codepoint 58880 not found in font, aborting. flutter build apk时报错

Wechat official account message notice "errCode": 40164, "errmsg": "invalid IP

Bash shell学习笔记(一)

Kali view IP address

微信公众号消息通知 “errcode“:40164,“errmsg“:“invalid ip

Bash shell学习笔记(六)
随机推荐
11 handle "self assignment" in operator=
Software Testing Overview: the background, essence and process of software testing
Halcon模板匹配之Shape
按二进制数中1的个数分类
Bash shell learning notes (I)
mysql20210906
Flutter报错 Incorrect use of ParentDataWidget When the exception was thrown, this was the stack:
Disable usbjatg in Altium Designer
Tutorial of putty
菜鸟看源码之SparseArray
Pengge C language - minesweeping 2021-08-16
创建EOS账户 Action
Happens-Before原则深入解读
MFC picture control
菜鸟看源码之ArrayList
Sql Server 数据库之初学体验
菜鸟看源码之LinkedBlockingQueue
12 don't forget every component when copying an object
104.二叉树的最大深度
用两个栈实现队列