Created
August 31, 2011 17:36
-
-
Save robertoaloi/1184144 to your computer and use it in GitHub Desktop.
Weird behaviour when calling Erlang from a Makefile on Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CMD="erl -noinput -eval 'erlang:display({foo, bar}).' -s init stop" | |
echo "Exec: $CMD" | |
exec $CMD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The same thing happened to my comment above (updated now). I had forgotten to markdownify it properly.
Anyway, shell expansion is the problem. The same happens on Linux. When you wrap the CMD text in double quotes, you apparently prevent the single quotes from being considered as quotes in the $CMD expansion, so you effectively get the following: