Hacker News new | ask | show | jobs
by np_tedious 719 days ago
Most shell-ish scripts probably use no dependencies and will not be picky about exact version
3 comments

Mmm. I’d argue that all shell scripts use a ton of dependencies that are different across Unix/Linux.

I. E. ‘sed -i’ is only in GNU sed. Same with ‘grep -P’.

I took my parent post as meaning the app language dependencies. Pip packages or ruby gems or "must be exactly python 3.12"
Correct but if you're in a situation where this is a issue you probably know about it and can use POSIX versions that are more portable.

Otherwise nobody thinks of it because most likely it is not being distributed.

This has bitten me many times
It’s why if my bash turns into more than a page or two I start re-evaluating it and turn it into python
Tons of scripts rely on coreutils (sed, awk, grep, head) to manipulate data.

All of those have wildly different behavior depending on their "flavors" (GNU vs Busybox vs BSD) and almost all of them depend on libc being installed.

That's not my experience at all. Shell is often glue between different utilities and unless it's being run in a controlled environment like a docker container, you have no idea what's on the base machine.