Comments (4)
Do you observe the output being incorrect on your machine? If so, what distro?
-e
is actually a non-standard option implemented by Bash. make invokes /bin/sh
which on Debian-derived distros is actually Dash, not Bash. Dash's echo
does not support -e
(it will literally print -e
if you try to pass this flag), but it interprets escapes by default (POSIX unhelpfully leaves it implementation-defined whether escapes are interpreted by default). So using -e
here would actually produce incorrect output, whereas currently it is correct (on my machine).
Weirdly, on OSX, where /bin/sh
is actually Bash, when invoked as sh
it exhibits Dash-like behavior in this respect, but on Debian if I symlink /bin/sh
to bash
I get Bash behavior even when invoked as sh
. So I suppose if you're using a distro where /bin/sh
is Bash, you might see the wrong output?
Sadly, using /bin/echo
won't solve this problem as on some platforms (OSX) it does not implement -e
either.
So -e
definitely won't work, but my current solution works on all machines I own. If it doesn't work on yours, maybe I just need to write multiple echo
statements.
from ekam.
I'm running Arch Linux which has its /bin/sh
symlinked to bash
. And you're right, it looks like -e
is a BASH-specific option. On a Ubuntu system running /bin/sh
symlinked to dash
, it works without the -e
option.
Supposedly, running bash
with the program name sh
will cause it to use set -o posix
to enable more posix-like features. But alas, this still doesn't fix echo
's behavior across all systems.
There are threes ways I think this could be fixed:
a) Break up the echo
into multiple calls.
b) Use printf
instead, e.g. printf "=====\nsomething\n=====
works fine
c) Detect what shell is running with sh --version
, then set a variable ECHO to either echo
or echo -e
and use `$(ECHO) "====\nsomething\n===="
Honestly, I don't think it's worth the effort but if you really wanted it to look the same on all systems, I would go with printf
. That would require minimal changes.
from ekam.
Oh, duh, printf! I actually figured this out once before and then forgot -- the Sandstorm Makefile only uses printf for exactly this reason. Durr. Thanks for the reminder.
from ekam.
Ahh, no problem.
from ekam.
Related Issues (20)
- Build fails due to kj/compat/http-test.c and http.c HOT 1
- LIBS processing is very touchy with whitespace
- ekam build seems to need c++14, not just c++11? HOT 5
- build runs kj/compat/http-test which appears to reach out to the internet HOT 2
- Print a message when a continuous build has finished building all targets. HOT 5
- ekam fails to build on arm64
- Proper incremental builds HOT 1
- ekam-bootstrap can't be ccached HOT 2
- the compile rule should be smarter about when it can avoid rebuilds. HOT 3
- std::logic_error when building using nix HOT 12
- Error building with glibc 2.33 because of _STAT_VER changes HOT 1
- Better support for "installed" dependencies HOT 1
- Touching compile.ekam-rule crashes Ekam HOT 2
- Build fails in /tmp HOT 6
- make fails with ccache-wrapped gcc HOT 16
- Don't wait until all tasks have failed before outputting error text HOT 1
- Add the ability to build a specific target, instead of everything at once HOT 1
- `-c`: Don't reprint all failed tasks when only a single task is rebuilt and fails HOT 1
- Ekam takes unnecessarily long for multi-step builds (almost all builds) HOT 1
- Support for generating Makefiles/CMake_files/... HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ekam.