Re: Unclosed quotes on heredoc mode

2021-12-20 Thread Chet Ramey
On 12/20/21 11:02 AM, Chet Ramey wrote: On 12/9/21 5:30 AM, Robert Elz wrote: Date:    Wed, 8 Dec 2021 09:56:50 -0500 From:    Chet Ramey Message-ID:  Let's take this in smaller steps, and try and sort out one issue at at time. Rack 'em. I had to go back and look

Re: Unclosed quotes on heredoc mode

2021-12-20 Thread Chet Ramey
On 12/9/21 5:30 AM, Robert Elz wrote: Date:Wed, 8 Dec 2021 09:56:50 -0500 From:Chet Ramey Message-ID: Let's take this in smaller steps, and try and sort out one issue at at time. Rack 'em. First, I think you're under a mistaken impression, which is revealed

Re: Unclosed quotes on heredoc mode

2021-12-09 Thread Robert Elz
Date:Wed, 8 Dec 2021 09:56:50 -0500 From:Chet Ramey Message-ID: Let's take this in smaller steps, and try and sort out one issue at at time. First, I think you're under a mistaken impression, which is revealed in the following paragraph. | The real question is

Re: Unclosed quotes on heredoc mode

2021-12-08 Thread Chet Ramey
On 11/28/21 2:29 PM, Robert Elz wrote: | So the ultimate question is whether or not the act of reading a command | substitution should reset this requirement. That's where we disagree. | The grammar is, at that point, reading a different command. "command" is a loaded word in sh

Re: Unclosed quotes on heredoc mode

2021-11-28 Thread Alex fxmbsw7 Ratchev
yea im sorry, .., .. code happily on plz On Sun, Nov 28, 2021, 21:25 Robert Elz wrote: > Date:Sun, 28 Nov 2021 20:51:33 +0100 > From:Alex fxmbsw7 Ratchev > Message-ID: nachji6-r...@mail.gmail.com> > > | a small comment on that /bin in PATH code.. is invalid, you

Re: Unclosed quotes on heredoc mode

2021-11-28 Thread Robert Elz
Date:Sun, 28 Nov 2021 20:51:33 +0100 From:Alex fxmbsw7 Ratchev Message-ID: | a small comment on that /bin in PATH code.. is invalid, you need to match | first non : beginning ahe not : ending end | case :$PATH: would fix it If it was the slightest bit

Re: Unclosed quotes on heredoc mode

2021-11-28 Thread Alex fxmbsw7 Ratchev
a small comment on that /bin in PATH code.. is invalid, you need to match first non : beginning ahe not : ending end case :$PATH: would fix it On Sun, Nov 28, 2021, 20:31 Robert Elz wrote: > Date:Sat, 27 Nov 2021 13:57:57 -0500 > From:Chet Ramey > Message-ID:

Re: Unclosed quotes on heredoc mode

2021-11-28 Thread Robert Elz
Date:Sat, 27 Nov 2021 13:57:57 -0500 From:Chet Ramey Message-ID: <5217c48e-c989-a163-5673-38995e35a...@case.edu> Warning: long message follows, give yourself time to digest it. | OK, if you do end up building the devel branch, I'd be interested | in these

Re: Unclosed quotes on heredoc mode

2021-11-27 Thread Chet Ramey
On 11/24/21 10:40 AM, Robert Elz wrote: Date:Tue, 23 Nov 2021 11:09:51 -0500 From:Chet Ramey Message-ID: <3a5f6f3a-aa73-d8ac-46f4-46467d5b3...@case.edu> | > I'll run our tests against the newest (released) bash | | OK. However, since, as I said, the

Re: Unclosed quotes on heredoc mode

2021-11-24 Thread Robert Elz
Date:Tue, 23 Nov 2021 11:09:51 -0500 From:Chet Ramey Message-ID: <3a5f6f3a-aa73-d8ac-46f4-46467d5b3...@case.edu> | > I'll run our tests against the newest (released) bash | | OK. However, since, as I said, the devel branch has a completely different |

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

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 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

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 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

Re: Unclosed quotes on heredoc mode

2021-11-20 Thread Robert Elz
Date:Sat, 20 Nov 2021 15:19:33 -0500 From:Chet Ramey Message-ID: | Right. Purposeful. There's a difference between done intentionally for pragmatic reasons, and done intentionally because it is the right thing to do and people should depend upon it remaining that

Re: Unclosed quotes on heredoc mode

2021-11-20 Thread Chet Ramey
On 11/20/21 12:35 PM, Robert Elz wrote: Date:Sat, 20 Nov 2021 11:33:37 -0500 From:Chet Ramey Message-ID: <4addb789-50b6-12a5-7b8a-8a082abaa...@case.edu> | I'm skeptical, but willing to be convinced. Bourne's shell allowed EOF to | terminate all sorts of

Re: Unclosed quotes on heredoc mode

2021-11-20 Thread Robert Elz
Date:Sat, 20 Nov 2021 11:33:37 -0500 From:Chet Ramey Message-ID: <4addb789-50b6-12a5-7b8a-8a082abaa...@case.edu> | I'm skeptical, but willing to be convinced. Bourne's shell allowed EOF to | terminate all sorts of things (quoted strings, command substitutions,

Re: Unclosed quotes on heredoc mode

2021-11-20 Thread Chet Ramey
On 11/19/21 9:18 AM, Robert Elz wrote: illusory compat issues. I have no idea what inspired this initially, but my guess would be a code bug no-one noticed. I'm skeptical, but willing to be convinced. Bourne's shell allowed EOF to terminate all sorts of things (quoted strings, command

Re: Unclosed quotes on heredoc mode

2021-11-19 Thread Robert Elz
Date:Thu, 18 Nov 2021 15:46:10 -0500 From:Chet Ramey Message-ID: <5c36d290-0e6e-2aa0-f388-20ec9369a...@case.edu> | Yeah, that's a bug. But it's probably baked in. Very. Just stopping parsing expansions while reading the here doc delim string would be easy (well,

Re: Unclosed quotes on heredoc mode

2021-11-18 Thread Chet Ramey
On 11/17/21 7:01 PM, Robert Elz wrote: > Date:Wed, 17 Nov 2021 15:47:37 -0500 > From:Chet Ramey > Message-ID: <420281e7-f3c4-8054-d390-9378080c2...@case.edu> > > | Every modern shell uses `$PATH' as the here-document delimiter > > Depends what you call modern

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Robert Elz
Date:Wed, 17 Nov 2021 15:47:37 -0500 From:Chet Ramey Message-ID: <420281e7-f3c4-8054-d390-9378080c2...@case.edu> | Every modern shell uses `$PATH' as the here-document delimiter Depends what you call modern shells - some ash derived shells (at least) don't,

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Chet Ramey
On 11/17/21 3:02 PM, Robert Elz wrote: > | bash-5.1$ cat << $PATH > > > | it should have terminated with the upper delimiter! > > What do you consider the "upper delimiter" ? > > This is one of the weirder aspects of shell syntax, and perhaps one > of bash's oddities. It's not. Every

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread João Almeida Santos
Ok, got it. It makes sense now! Thank you very much for your detailed explanation guys; now that I understand it, I’ll try to implement that on my mini shell. It’s a bit too soon, but merry Christmas to you all! Kind regards, João Almeida Santos

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Chet Ramey
On 11/17/21 10:33 AM, Robert Elz wrote: > There are several (IMO) > bugs in the way bash processes here documents, Such as? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.edu

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Chet Ramey
On 11/17/21 1:45 PM, João Almeida Santos wrote: > No, it’s on the email...Anyway, here’s the text! > > bash-5.1$ echo $PATH > /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/:/usr/local/bin/:/usr/local/bin/ > > bash-5.1$ cat << $PATH >>

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Robert Elz
Date:Wed, 17 Nov 2021 18:45:05 + From:=?utf-8?Q?Jo=C3=A3o_Almeida_Santos?= Message-ID: | No, it's on the email... It wasn't, but some lists filter attachments (remove them) - this might be one. | bash-5.1$ echo $PATH |

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Greg Wooledge
On Wed, Nov 17, 2021 at 06:45:05PM +, João Almeida Santos wrote: > bash-5.1$ cat << $PATH That's not how a here-document is intended to be used. A here-document lets you drop a blob of text directly into your script and use that as standard input for some command, without needing to store

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread João Almeida Santos
No, it’s on the email...Anyway, here’s the text! bash-5.1$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/:/usr/local/bin/:/usr/local/bin/ bash-5.1$ cat << $PATH > /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/:/usr/local/bin/:/usr/local/bin/ > it should have terminated with the upper

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Greg Wooledge
On Wed, Nov 17, 2021 at 06:30:08PM +, João Almeida Santos wrote: > Thank you for your reply Robert and Lawrence! > > I understand the description alone is hard to follow, so I think the image > below should make it clearer. Otherwise let me know! > > > Kind regards, > João Almeida Santos

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Alex fxmbsw7 Ratchev
u forgot to attach the picture .. ? On Wed, Nov 17, 2021, 19:31 João Almeida Santos wrote: > Thank you for your reply Robert and Lawrence! > > I understand the description alone is hard to follow, so I think the image > below should make it clearer. Otherwise let me know! > > > Kind regards, >

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread João Almeida Santos
Thank you for your reply Robert and Lawrence! I understand the description alone is hard to follow, so I think the image below should make it clearer. Otherwise let me know! Kind regards, João Almeida Santos

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Robert Elz
Date:Wed, 17 Nov 2021 12:35:42 + From:=?utf-8?Q?Jo=C3=A3o_Almeida_Santos?= Message-ID: | While testing the heredoc mode, I realized that the $ is not | interpreted as variable expansion. It depends how you set up the heredoc, please give an example of

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Lawrence Velázquez
On Wed, Nov 17, 2021, at 7:35 AM, João Almeida Santos wrote: > I’m a programming student currently on 42 School in Lisbon, and one of > our projects is to create a minishell, and to mimic the behavior of > bash. Nice! > While testing the heredoc mode, I realized that the $ is not >

Unclosed quotes on heredoc mode

2021-11-17 Thread João Almeida Santos
Hello, First of all thank you for doing great (and free) software! I’m a programming student currently on 42 School in Lisbon, and one of our projects is to create a minishell, and to mimic the behavior of bash. While testing the heredoc mode, I realized that the $ is not interpreted as