EOF
You got that? evaluate it in your shell. Now Put it into a file and try to "sh file.sh". You're going to see the funny {"}. Go figure...
- sh doesn't understand about nested {} inside {}
- Take into account that bash or zsh do, so none of this applies there, you have to test it on pure sh.
- ${FOO:-"{} is what gets interpreted as part of the variable
- as $FOO is not defined, '"{' should be outputted,
- leaving the final "{"}
- But nope. Because quotes inside a variable expansion do not pass through
- So the final {"}
- Bonus points for this not happening in bash
- More bonus points for this being inside a makefile that calls the file as $(SHELL) file.sh. And different platforms use different $(SHELL) by default.
- Mine (ubuntu) uses /bin/sh (which is linked to /bin/dash), others might use busybox, and MacOS uses something that does not do any of the above (zsh?)
No hay comentarios:
Publicar un comentario