Sample Header Ad - 728x90

Does bash (or zsh) "officially" mandate the use of tabs for indentation in scripts?

2 votes
1 answer
923 views
I recently came across the following statement (source ; emphasis added): > For shell scripts, using tabs is not a matter of preference or style; *it's how the language is defined*. I am trying to make sense of this claim. Of course, it is somewhat loosely worded1, but I would like to know if there is any truth to it. In particular, I would like to know if the official documentation for either bash or zsh (the two shells I routinely write scripts for) say anything approaching a mandate or recommendation to use tabs for indentation of source code. (I would appreciate explicit references to the supporting paragraphs in this documentation.) (FWIW, let me point out that I am aware of the fact that, in practice, both bash and zsh readily interpret scripts that are *not* indented exclusively with tabs. Therefore, I don't expect the documentation for either shell to go much further than a strong recommendation, if they mention the matter at all.) --- 1 For one thing, it refers simultaneously to "shell scripts" and "the language", which contradicts the facts that there are multiple shells in current use, each defining its own language.
Asked by kjo (16299 rep)
Oct 25, 2022, 02:07 PM
Last activity: Oct 25, 2022, 02:12 PM