Hacker News new | ask | show | jobs
by njkleiner 2014 days ago
If your argument for using the shell (as opposed to a real programming language such as Python) is portability, writing a shell script that is not POSIX compliant literally defeats the point.

Also, 100 lines of UX-related bloat hardly classifies as "minimal".

1 comments

> writing a shell script that is not POSIX compliant literally defeats the point.

Your argument is invalid. Even if the script isn't posix compliant you are comparingb portability with regards to the availability of bash vs python binaries on your target machine. Do you have data to support python is more likely to exist in linux machines than bash?

> Do you have data to support python is more likely to exist in linux machines than bash?

That's not what I'm saying. I never claimed Python was more widely supported that Bash, in terms of this argument you should use neither, that's the whole point.

What I'm saying is that it does not make sense to use Bash over e.g. Python in favor of supporting a wider range of machines while at the same time limiting support to Bash environments when you could use POSIX instead which is a subset of Bash and therefore more widely supported than Bash and Python.

Do you have data to prove that POSIX shell less likely to be supported than Bash and Python respectively? Otherwise I don't see how my argument is invalid.

Of course Bash support is larger than Python support (that's what you seem to be saying), and therefore even a Bash-specific script is more portable. What I'm suggesting is that it's contradictory to stop there when you could simply drop the bashisms and go for full POSIX compliance for even more portability.

That said, if I'm misunderstanding you, please point out how so.

No thats a fair argument. I didn't quite get it initially. I still find the template usefull for my personal usecases but I also get your point
There's also the fact that while Bash is common on Linux, it's not generally the default shell for the BSDs or other UNIXes. But most of them will have Python installed. Also it's easier to use Python on Windows than a POSIX shell, though neither is present by default.
I think the argument made here is that choosing bash over python because of portability doesn't square with using non-POSIX-compliant bash commands.
I noticed python is somehow sucked as an accidental dependency of unrelated packages. How do I find the culprit?