today in shell scripting:
if you:
- use `#!/bin/sh` (and not /bin/bash or /usr/bin/env bash), and
- use `echo -n ...` (to say "hey, no newline at the end please)
… you will get "-n" in the output on MacOS.
afaict, i think it's a case of:
- macOS (BSDish), when in /bin/sh, faithfully recreates old /bin/sh echo, which doesn't respect -n.
- the various linuxes do not seem to bother with this, and have -n work the same as it does in bash (often because sh is an alias to bash).
the more u know etc