macOS has a 12+ year old bash. Also, even with Homebrew patching up Apple's neglect, coreutils behaves differently under a Darwin kernel than Linux. A repeat source of aggravation for myself is the behavior of 'ps'.
that's not due to the kernel, that's because it's bsd ps instead of gnu ps. sed is the one that gives me the most irritation, there's basically no way to write useful cross-OS sed scripts.