3 ms·
I would assume if you put /bin/bash as your shebang that you're expecting to get bash-isms. I think the problem you're complaining about (which is a real one) i
by gh02t 5y ago
I would assume if you put /bin/bash as your shebang that you're expecting to get bash-isms. I think the problem you're complaining about (which is a real one) is people putting /bin/sh and expecting bashisms. Debuntu being problematic here is more a side effect of bad practice.
- chasil 5y agoBash has a POSIX mode. Knowing when to switch into and out of this mode, and what impact it has, is a more advanced subject that should not burden those learning the Borne family. It is better to start with Almquist, or another pure POSIX implementation, with documentation specific to standard adherence. More advanced shell features should wait.
- gh02t 5y agoI have mixed feelings. On paper I agree with you, people should start with POSIX shell. In practice I'm not sure how relevant that is anymore. I'm not really convinced bash should be the default thing people learn, but I think there's a decent argument that people should just start off with the shell they're going to actually use. You should, however, be aware that there is a distinction, and if you're learning/writing bash and not POSIX shell you should specify /bin/bash not /bin/sh. But you don't necessarily need to know all the nuances of how bash differs unless you have a need to write POSIX compliant shell.
- chasil 5y agoFor me, I just want a shell that works. Without a nuanced understanding of standards, extensions, and platform availability, new bash users will get large amounts of shell usage that doesn't work. To avoid that frustration, learn POSIX. That works everywhere that matters.