当前位置:网站首页>-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
边栏推荐
- 使用float实现左中右布局,中间内容自适应
- 微信公众号开发 获取openid时报错40029 invalid code 问题的解决
- 智能合约dapp系统开发流程技术
- Sword finger offer (44): flip the word order sequence
- 构建ARM嵌入式开发环境
- RT thread learning notes (VII) -- open the elmfat file system based on SPI flash (middle)
- 【小程序】onReachBottom 事件为什么不能触发 ?(一秒搞定)
- 二叉树的遍历 递归+迭代
- 微信公众号消息通知 “errcode“:40164,“errmsg“:“invalid ip
- Build ARM embedded development environment
猜你喜欢

菜鸟看源码之ArrayDeque

$router和$route的区别

232. Implement queue with stack

按二进制数中1的个数分类

菜鸟看源码之HashTable

【小程序】onReachBottom 事件为什么不能触发 ?(一秒搞定)

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

Bash shell学习笔记(三)
![[leetcode daily question 2021/5/8]1723. The shortest time to complete all work](/img/e7/a48bb5b8a86cbc4cd5b37bb16661a8.png)
[leetcode daily question 2021/5/8]1723. The shortest time to complete all work
随机推荐
0x00007FFD977C04A8 (Qt5Sqld.dll)处(位于 a.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000000000000010 时发生访问冲突
list升序和降序
242.有效的字母异位词
SCADA和三大工业控制系统PLC、DCS、FCS
Sql Server 数据库之数据类型
LIst和Dictionary实例应用(※)
Pengge C language lesson 4 (3)
2021-08-14 Sanzi chess
Halcon模板匹配之Shape
Add touch screen driver for stemwin 5.22 on Shenzhou IV development board
Bash shell学习笔记(三)
Sword finger offer (52): regularization expression
Sql Server 数据库之完整性约束
Traversal recursion + iteration of binary tree
用两个栈实现队列
Bash shell learning notes (I)
Software Testing Overview: the background, essence and process of software testing
很多人都不清楚自己找的是Kanban软件还是看板软件
Codepoint 58880 not found in font, aborting. flutter build apk时报错
MultipartFil转为File