I ran a Docker container and copied a statically-linked curl and bash onto a scratch image and ran it, it does not work:
$ docker run -it --rm $(docker build -q .)
/srvmon.sh: line 162: date: command not found
$ cat Dockerfile
FROM scratch
COPY bash /usr/bin/bash
COPY curl /usr/bin/curl
COPY srvmon.sh /srvmon.sh
CMD ["/usr/bin/bash", "/srvmon.sh"]
I'm not pointing this out to be pedantic. I'm pointing it out because there is a common misconception that all these things like "date" and "cat" and "mkdir" are part of Bash, but they're not, they're part of coreutils and there are dramatically different versions of coreutils on different installations of Linux, macOS, BSD, etc., and some environments (like barebones Docker containers) don't have coreutils at all.
People who use containers where they aren't required or even sensible deserve, and should expect, what they intentionally get. Yours is not an argument showing that coreutils aren't everywhere. They are. It only shows that you specifically went out of your way to create an obscure environment designed explicitly to not have what it needed.
My argument isn’t about containers, I was using that as an easy way to illustrate my point.
I care about this because I deal with it all the time. Coreutils programs have pretty different behavior across distributions and OSs, we shouldn’t sweep implicit dependencies under the rug.
Agree with superkuh in this point. If you only have a hammer every problem looks like a nail. But I've updated the Readme with coreutils as a dependency.
I ran a Docker container and copied a statically-linked curl and bash onto a scratch image and ran it, it does not work:
I'm not pointing this out to be pedantic. I'm pointing it out because there is a common misconception that all these things like "date" and "cat" and "mkdir" are part of Bash, but they're not, they're part of coreutils and there are dramatically different versions of coreutils on different installations of Linux, macOS, BSD, etc., and some environments (like barebones Docker containers) don't have coreutils at all.