簡體   English   中英

找不到命令(Linux終端)路徑設置

[英]Command not found (Linux terminal) Path settings

我正在使用緩存模擬器,並且在執行時遇到以下錯誤。 我正在使用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腳本,因為您為其指定了“可執行”模式。

首先要做的是編譯C文件,例如

cc csim.c -o csim

...,然后運行生成的可執行程序。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM