shortbread-tilemaker
shortbread-tilemaker copied to clipboard
Use /usr/bin/env bash instead of bash directly
I am not a fan of that. Who know what bash will be in the PATH? Any extra step makes is one extra thing that can go wrong. But I don't feel strongly about that.
Note the same shebang is used in https://github.com/shortbread-tiles/shortbread-tilemaker/blob/fb789064f307c6f0ddab84e8891748def080393b/build_test_dataset.sh#L1
I run the script on Linux distro which doesn't have bash in /bin/bash hence the PR.
It's possible that /bin/bash could be better (newer version for example) than bash from PATH but that depends on OS/user configuration.
What linux distro doesn't have it? Distros which have merged /bin and /usr/bin usually have a symlink from one to the other?
I used NixOS where there is no /bin/bash and no /usr/bin/bash
Current version of bash is at /nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash (path changes when there is a bash update).
Which is linked at /run/current-system/sw/bin/bash and /run/current-system/sw/bin is in $PATH
Perhaps we can use /bin/sh instead. That surely should be where it belongs even on Nixos?
Perhaps we can use /bin/sh instead. That surely should be where it belongs even on Nixos?
Indeed, there is /bin/sh which links to bash. But in general that can be a different shell. If any bash-specific features are needed then I would suggest to use AFAIK the most portable way which is proposed in this PR