patchThe GNU Bourne-Again SHell - Patches: patch #10517, Nested compound lists parsing...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10517: Nested compound lists parsing issue ((echo hello)\n | cat -e)

Submitter:  Andrii Dokhniak <justlinuxuser>
Submitted:  Thu 24 Apr 2025 07:56:43 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Open

Fri 16 May 2025 02:47:56 PM UTC, comment #4: 

I fixed this in the bash devel branch, and the fix will be in the next bash-5.3 release candidate.

Chet Ramey <chet>
Group administrator
Mon 28 Apr 2025 04:13:36 PM UTC, comment #3: 

On 4/26/25 9:01 AM, Andrii Dokhniak wrote:

> Follow-up Comment #2, patch #10517 (group bash):
>
>
> comment #1:
>> This isn't a parsing issue. Are you reporting the command-oriented history
>> code adding the semicolon as the bug?
>
> 1. Sorry for not filing this as a bug, I misclicked
>
> Not just that, the command also doesn't execute properly,
> the hello doesn't get piped to cat -e, so it is a parsing issue, as this
> should be a syntax error.


Ok, I see what you mean. Thanks for the report; I'll take a look. I agree
that the unescaped newline should make it a syntax error.

Chet

Chet Ramey <chet>
Group administrator
Sat 26 Apr 2025 01:00:56 PM UTC, comment #2: 


comment #1:

> This isn't a parsing issue. Are you reporting the command-oriented history code adding the semicolon as the bug?


1. Sorry for not filing this as a bug, I misclicked

Not just that, the command also doesn't execute properly,
the hello doesn't get piped to cat -e, so it is a parsing issue, as this should be a syntax error.

In the compund lists, a newline is treated as a significant, so it's the same as a semicolon, which is why the history gets changed there, but, a significant newline, and a pipe afterwards should be a syntax error. Mb this example is clearer:


$ ((echo hello)
> | echo world)
hello
world


The pipe just does nothing, which, If I understand the syntax of bash properly, shouldn't happen

Andrii Dokhniak <justlinuxuser>
Fri 25 Apr 2025 07:20:34 PM UTC, comment #1: 

This isn't a parsing issue. Are you reporting the command-oriented history code adding the semicolon as the bug?

Chet Ramey <chet>
Group administrator
Thu 24 Apr 2025 07:56:43 AM UTC, original submission:  


$ ((echo hello)<Return>
> | cat -e)<Return>
hello <- this is not a typo, no $
$ <Up arrow for history>
$ ((echo hello); | cat -e)


The pipe can be replaced with any operator, and it still brakes

Andrii Dokhniak <justlinuxuser>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by justlinuxuser (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-05-16 chet StatusNeed Info Done
    2025-04-25 chet StatusNone Need Info

    Back to the top

    Powered by Savane 3.15-4cd8.
    Corresponding source code