Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 12892  / 1 Year ago, wed, april 5, 2023, 2:57:15

all,



I have found that the same Makefile works well in Mac OS X, but does not work in Ubuntu. The snippet is as following:



start:
@echo $(seperator)
@if [[ "$(PROJECT)" == "" ]]; then
echo " Project powered by CodeMate!";
else
echo " $(PROJECT)";
fi
@echo $(seperator)


and make complains:



/bin/sh: [[: not found


Any idea?



Cheers,



Li






Updates:



I have changed the above conditional Bash statements to:



if test "$(PROJECT)" = ""; then 


then things work fine. So what is wrong with "[["?


More From » bash

 Answers
5

Makefiles use sh by default, not bash.



In Ubuntu sh point to dash, a POSIX compliant and minimalistic shell, not providing the [[ keywork.


[#40949] Wednesday, April 5, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ionash

Total Points: 214
Total Questions: 111
Total Answers: 116

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;