Re: Unclosed quotes on heredoc mode

2021-11-23 Thread Chet Ramey

On 11/20/21 5:54 PM, Robert Elz wrote:

 Date:Sat, 20 Nov 2021 15:19:33 -0500



   | How about this. You show me examples where bash (devel bash) does what you
   | think is the wrong thing, and we agree it's a bug, I'll fix it.

I'll run our tests against the newest (released) bash (5.1.12(1)-release)


OK. However, since, as I said, the devel branch has a completely different
implementation, this is not particularly useful.


[what does the (1) represent??   It always seems to be (1) in versions I see.]


It's the build version: how many times have you built in this build tree?
I get into the hundreds before I recycle it.



   | The devel bash already does this.

What the devel one does is unknown to me, I don't think I even have
the means to obtain it (I have nothing at all git related, and no interest
in changing that state of affairs).


Whatever. You do you. Don't be surprised if many of my answers turn out to
be "that's already fixed in the devel branch."

It just seems like a tremendous amount of wasted effort to point out things
that have already been changed.



What I meant was this one:

cat  and a here doc operator in a command substitution might not encounter
   | > a newline until after the cmdsub text has ended - the next following 
newline
   | > token provides there here doc text.
   |
   | I can't imagine a useful example of this that isn't an error.

That's the 2nd example above, and a very normal thing to want to do, very
short command substitutions (most of them) prefer to be complete within 1 line.


If you want the text of the here-document to apply to the command
substitution, put it inside the command substitution. Otherwise, you
violate the "any valid shell script" clause and the behavior varies there.



Note that neither in POSIX, nor anywhere else, has there ever been any
requirement on the heredoc data other than that it comes after the next
newline (which should, we agree, be newline token, not newline character).


OK.


Since heredocs are a lexical object, this processing is totally unaffected
by whatever semantics the grammar is extracting from the tokens the lexer is
returning to it, the grammar just increments the "number of heredocs needed"
counter, supplies the end words for eac

Re: Unclosed quotes on heredoc mode

2021-11-23 Thread Alex fxmbsw7 Ratchev
in stacked up heredocs on one line, one has just to think programmical
serial... the bash is tilleof parser data gather mode

{ printf %s\\n "$( 

Re: Unclosed quotes on heredoc mode

2021-11-23 Thread Martijn Dekker

Op 20-11-21 om 23:54 schreef Robert Elz:

What the devel one does is unknown to me, I don't think I even have
the means to obtain it (I have nothing at all git related, and no interest
in changing that state of affairs).


Github allows downloading a gzipped tarball of any branch's current 
state via https://github.com///tarball/


There's a regularly updated mirror of the bash repo here:
https://github.com/bminor/bash/

So, the URL to the .tgz for the current bash devel branch is:
https://github.com/bminor/bash/tarball/devel

...and, since it came up in this thread, this one is for the current 
ksh93 development code (not a mirror):

https://github.com/ksh93/ksh/tarball/master

--
||  modernish -- harness the shell
||  https://github.com/modernish/modernish
||
||  KornShell lives!
||  https://github.com/ksh93/ksh



Re: Unclosed quotes on heredoc mode

2021-11-23 Thread David
On Wed, 24 Nov 2021 at 14:36, Martijn Dekker  wrote:

> There's a regularly updated mirror of the bash repo here:
> https://github.com/bminor/bash/

Or if you care about software freedom you might prefer:
  https://git.savannah.gnu.org/cgit/bash.git



Re: Unclosed quotes on heredoc mode

2021-11-23 Thread Lawrence Velázquez
On Tue, Nov 23, 2021, at 10:35 PM, Martijn Dekker wrote:
> Op 20-11-21 om 23:54 schreef Robert Elz:
>> What the devel one does is unknown to me, I don't think I even have
>> the means to obtain it (I have nothing at all git related, and no interest
>> in changing that state of affairs).
>
> Github allows downloading a gzipped tarball of any branch's current 
> state via https://github.com///tarball/
>
> There's a regularly updated mirror of the bash repo here:
> https://github.com/bminor/bash/
>
> So, the URL to the .tgz for the current bash devel branch is:
> https://github.com/bminor/bash/tarball/devel

The official repository also provides a snapshot at
.

-- 
vq