linux - 可以在终端中执行命令,但不能从文本文件中执行
问题描述
我在 WSL 上使用 Ubuntu 运行代码。每次我编辑一些 C 文件时,我都需要执行一个 makefile 并运行一个安装程序,以确保这些更改反映在我正在使用的 python 包中。我需要执行的命令集是
make clean
make
cd python
python setup.py install --user
当我在终端中执行它们时,这非常有效。为了让我的生活更轻松,我决定将这些命令放在一个文本文件Compile.txt
中,以便在需要编译相关文件时执行。我发现了这个问题并试图复制它的解决方案。但是,每当我输入./Compile.txt
终端时,我都会收到错误
'. Stop. No rule to make target 'clean
gcc -o .o
gcc: fatal error: no input files
compilation terminated.
make: *** [<builtin>: .o] Error 1
./Compile.txt: line 7: cd: $'python\r': No such file or directory
python: can't open file 'setup.py': [Errno 2] No such file or directory
谁能解释我做错了什么?对于任何滥用术语的行为,我深表歉意,因为我对 Linux 还是很陌生。
提前致谢。
解决方案
推荐阅读
- css - 响应式网页在 Firefox 的开发模式下工作,但在我的 S9 Firefox 上却不行
- python-3.x - 如何为迭代 postOrder 遍历复制树以保护树
- regex - Laravel - 正则表达式路由匹配所有内容,但不完全匹配一个或多个单词
- python - 调用时出现 Python 描述符属性问题
- python - Pandas pd.Grouper 的 sum() 问题
- visual-studio - CMake 错误:无法创建命名生成器 Visual Studio 15 2017(运行英特尔 openVINO 工具包的验证脚本时)
- mysql - 没有笛卡尔积的 INNER JOIN 的替代方案
- linux - 是否可以获取现在正在执行的命令参数?
- python - 使用 Django 创建网站,但图像在部署到 heroku 时未显示,但在 localhost 中显示
- python - 获取 nltk k 的惯性意味着使用 cosine_similarity 进行聚类