Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14196

Clarify cases of implicit and explicit line continuation

From Shriramana Sharma <samjnaa@gmail.com>
Newsgroups gnu.bash.bug
Subject Clarify cases of implicit and explicit line continuation
Date 2018-06-01 10:58 +0530
Message-ID <mailman.912.1527839017.1292.bug-bash@gnu.org> (permalink)

Show all headers | View raw


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 ஶ்ரீரமணஶர்மா श्रीरमणशर्मा 𑀰𑁆𑀭𑀻𑀭𑀫𑀡𑀰𑀭𑁆𑀫𑀸

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Clarify cases of implicit and explicit line continuation Shriramana Sharma <samjnaa@gmail.com> - 2018-06-01 10:58 +0530

csiph-web