提示のshellコードですが以下の###部の行でエラーが出ますこれは何が原因なのでしょうか?
Shigurechan@Shigurechan:~/Project/ConsoleGame/lib/src $ sh run.sh run.sh: 4: [0: not found
参考サイト:https://qiita.com/zayarwinttun/items/0dae4cb66d8f4bd2a337
#!bin/bash g++ -c Console.cpp if [$? = "0"] ; then ####### ここです。 ar rcs sample.a *.o g++ -o test Main.cpp sample.a if [$? = "0"] ; then ./test else echo echo echo " Compile Error" echo echo fi fi
[ と $? の間にスペースをいれていないからです。
if [ $? = "0" ] ; then
回答1件
あなたの回答
tips
プレビュー