有無@在echo前面這個要分情況來說明,如果是寫在Makefile裏面:
@echo
這樣不會回寫命令行,什麼意思呢,就是直接顯示echo輸出的內容.
在上一篇介紹go Makefile時,有下面這樣一段:
.PHONY: clean test
test:
@echo "testing..."
go test github.com/user/stringutil
@echo "test Done!"
執行後是:
jack@jxes-VirtualBox:~/gopath$ make test
testing...
go test github.com/user/stringutil
ok github.com/user/stringutil 0.011s
test Done!
echo
在Makefile中沒有@就會回顯命令行內容,將上面栗子中的@去掉後的情形如下:
.PHONY: clean test
test:
echo "testing..."
go test github.com/user/stringutil
echo "test Done!"
執行後是:
jack@jxes-VirtualBox:~/gopath$ make test
echo "testing..."
testing...
go test github.com/user/stringutil
ok github.com/user/stringutil 0.009s
echo "test Done!"
test Done!
最後說下,在shell下面,是沒有@echo這種寫法的。