Comment by strenholme
5 days ago
Spaces vs. tabs causes a lot of issues for Python programmers who share their code with other programmers. The other place where spaces vs. tabs is an issue is with makefiles, probably one of the most annoying features of POSIX.
I also remember old school bourne shell wanting tabs in some places (case statements?), but bash doesn't have that issue.
These days, I try avoid them outside of makefiles.
> I also remember old school bourne shell wanting tabs in some places (case statements?), but bash doesn't have that issue.
From bash(1):
> If the redirection operator is <<-, then the shell strips all leading tab characters from input lines and the line containing delimiter.
That's also how it works with zsh.
This is why my here-doc delimiters are always un-indented despite surrounding indentation.
Wish bash had something like ruby's `<<~`, which accepts either space or tab indentation of the delimiter and additionally removes the indentation of the block (likely based on the least indented line).
Considering the way `/bin/sh` had a bunch of different implementations before POSIX standardization minimized that in the mid-1990s, I wouldn’t be surprised if one of those distinguished spaces from tabs.
That said, the original UNIX V7 implementation of /bin/sh didn’t distinguish different kinds of whitespace:
https://www.in-ulm.de/~mascheck/bourne/v7/
You're right. I don't see any evidence of what I claimed. It doesn't look like it was ever whitespace sensitive. This would have been in the 90's, probably Linux. I feel like the compatibility issue involved case statements, maybe it was the parenthesis thing.