[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clarify cases of implicit and explicit line continuation
From: |
Shriramana Sharma |
Subject: |
Clarify cases of implicit and explicit line continuation |
Date: |
Fri, 1 Jun 2018 10:58:29 +0530 |
Hello. See
https://unix.stackexchange.com/questions/253518/where-are-bash-line-continuations-after-and-documented.
Roughly put, wherever lines terminating with a particular token are
syntactically valid, they are taken as complete, and an explicit \ is
required to continue the line, but lines ending with && || or I and
lines where an array definition has been started with =( but not
closed with a ) implicitly continue to the next physical line. This is
not documented under the manual section describing explicit line
joining/continuation:
https://www.gnu.org/software/bash/manual/html_node/Escape-Character.html#Escape-Character
but the similar specification for Python is properly and clearly
documented in the Python docs:
https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining
The StackExchange conversation mention of "In POSIX, it's specified
via the grammar rules" seems to indicate that though this behaviour is
not documented, it is the expected behaviour as per POSIX.
Thus I request that the Bash docs clearly document this behaviour.
--
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा 𑀰𑁆𑀭𑀻𑀭𑀫𑀡𑀰𑀭𑁆𑀫𑀸
- Clarify cases of implicit and explicit line continuation,
Shriramana Sharma <=