我的同事用的是 Ubuntu,我用的是 openSUSE,我们用同样的 makefile 编译了同样的源代码,我的环境运行良好,但是我的同事不行,总是输出无法识别的-e
选项。我们检查makefile,只找到echo
命令使用-e
选项。
Dose Ubuntu 的 echo 功能和其他的有什么不同?
+++++在makefile中更新,回显定义为:
TOOLSDIR =
ECHO = $(TOOLSDIR)echo -e
$(TOOLSDIR) 是工具的目录,这个 make 文件可以检测编译环境,如果 linux 或有 CYGWIN:
$(TOOLSDIR)
为空,如果是windows,则进入WIN32版本回显工具目录,如:
TOOLSDIR = $(subst /,\,$(MAKEDIR)/tools/WIN32/)
我们执行make后,ubuntu会输出:
致命错误:L3900U:无法识别的选项“-e”。
但是,openSUSE 没有这个错误
+++++更新回声-e
我在ubuntu中写了一个测试makefile
all:
echo -e hello
它输出:
回声 -e 你好
你好
+++++更新 openSUE ( 12.1 ) 和 ubuntu ( 12.04 )中的 makefile 测试
all:
echo -e "hello 1"
echo -e hello 2
echo -e he\nllo3
echo -e "he\nllo4"
- 打开使用,输出为:
回声-e“你好1”
你好 1
回声 -e 你好 2
你好 2
echo -e he\nllo3
henllo3
echo -e "他\nllo4"
他
llo4
- 在 ubuntu 中,输出为:
回声-e“你好1”
-e 你好 1
回声 -e 你好 2
你好 2
echo -e he\nllo3
henllo3
echo -e "他\nllo4"
-e他
llo4
同时,我在ubuntu中测试,echo without -e
,结果和openSUSE一样,echo with-e