You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this error is a little bit tricky but it happens often when using heredoc <<- redirection operator because space and tabs are not visible in that case.
If the redirection operator is ‘<<-’, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion. Source
The error in test_invalid.txt is not detected. There is spaces instead of tabs before EOF.
# bash test_invalid.txt
test_invalid.txt: line 9: warning: here-document at line 5 delimited by end-of-file (wanted `EOF')
test_invalid.txt: line 10: syntax error: unexpected end of file
Expected : There is a parsing error detected.
This test_valid.txt is valid but the syntax coloration is wrong.
# bash test_valid.txt
# cat /tmp/file
spaces before
EOF
This text is written inside the /tmp/file.
Expected : This text is written inside the /tmp/file. is grey like spaces before.
It could also be interesting in that case to show a difference between whitespace and tab because whitespace will be kept and tab will be ignored.
The text was updated successfully, but these errors were encountered:
I know this error is a little bit tricky but it happens often when using heredoc
<<-
redirection operator because space and tabs are not visible in that case.EOF
.Expected : There is a parsing error detected.
Expected :
This text is written inside the /tmp/file.
is grey likespaces before
.whitespace
andtab
becausewhitespace
will be kept andtab
will be ignored.The text was updated successfully, but these errors were encountered: