hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
10.88k stars 578 forks source link

Missing /bin/echo on NixOS #208

Closed hri closed 4 years ago

hri commented 4 years ago

Make has failed on NixOS due to a /bin/echo command. There is no binary in a bin directory (or should not be).

Mittigating this problem (symlink in bin, or using echo - on zsh it's a built-in command anyway) results in a successful build of the book. (Great, Thank you!)

[nix-shell: milewski-ctfp-pdf/src]$ make
/bin/echo -n '\newcommand{\OPTversion}{' > version.tex
/bin/sh: /bin/echo: No such file or directory
hmemcpy commented 4 years ago

Oh ouch! If you can cleanly solve this for both NixOS and zsh, I would really appreciate a pull request!

hri commented 4 years ago

Sure. Just note that I am going to try printf instead of echo (all four instances in Makefile, maybe You will prefere only changing two echo -n occurences or don't use printf at all).

This Unix world is full of Wonders, "cleanly solve" is not really translucent for me. From what I have read, printf should be used for better portability. Phew...

https://askubuntu.com/questions/467747/which-is-better-printf-or-echo https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo

hmemcpy commented 4 years ago

Fixed by #209. Thank you!