gpt4 book ai didi

linux - 未找到命令(Linux 终端)路径设置

转载 作者:太空宇宙 更新时间:2023-11-04 03:51:28 26 4
gpt4 key购买 nike

我正在开发缓存模拟器,在执行时出现以下错误。我正在使用 Ubuntu 终端来执行该程序。我不明白错误的问题,因为我已将所有附加文件映射到主程序。

我需要将程序的路径设置到任何目录才能执行它们吗?

首先为了授予权限,我执行了以下命令,这样我就不会收到“权限错误”

enter code here
chmodx +x ./csim.c

然后我执行了以下命令以执行最终的程序

enter code here
./csim.c [-hv] -s 5 -E 1 -b 5 -t traces/long.trace

输出终端错误

./csim.c: line 1: /bin: Is a directory
./csim.c: line 2: cachelab.c: command not found
./csim.c: line 3: cachelab.c: command not found
./csim.c: line 4: cachelab.c: command not found
./csim.c: line 5: cachelab.c: command not found
./csim.c: line 6: cachelab.c: command not found
./csim.c: line 7: cachelab.c: command not found
./csim.c: line 8: cachelab.c: command not found
./csim.c: line 9: cachelab.c: command not found
./csim.c: line 10: cachelab.c: command not found
./csim.c: line 11: traces/: Is a directory

我该如何解决这个问题?

最佳答案

您正在尝试执行一个 C 源代码文件,shell 将其解释为 shell 脚本,因为您已为其指定了“可执行”模式。

首先要做的是编译C文件,例如

cc csim.c -o csim

...然后运行生成的可执行程序。

./csim [-hv] -s 5 -E 1 -b 5 -t traces/long.trace

关于linux - 未找到命令(Linux 终端)路径设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26226413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com