Skip to content

Parser bug with command substitutions in strings inside parenthesis #8500

Closed

Description

@Darkshadow2

Version: 3.3.1-671-ge2331eb03

(Just noticed with this version, most likely is there since this was introduced)

I've been updating some scripts to use this, and ran into this bug. If you have two (or more) command substitutions inside parenthesis in a string, you get a parser error about mismatched parenthesis. An example:

$ math "($(random) - $(random))"
fish: Mismatched parenthesis
math "($(random) - $(random))"
     ^

This isn't just a problem with math, it's a general problem. You can replace it with any command, and you'll get the same error.

It does work with only one command substitution inside parenthesis:

math "($(random) / 2) x $(random)"

Activity

  1. added a commit that references this issue on Nov 29, 2021
    3007467
  2. krobelus commented on Nov 29, 2021

    @krobelus
    Contributor

    Thanks for reporting. I have a fix (3007467) but it uses evil magics so I'll try to find a better one

  3. added this to the fish 3.4.0 milestone on Nov 30, 2021
  4. added
    bug
    regression
    on Nov 30, 2021
  5. zanchey commented on Nov 30, 2021

    @zanchey
    Member

    I've tagged this as a regression only because it doesn't need to go in the release notes.

  6. added a commit that references this issue on Dec 12, 2021
  7. locked as resolved and limited conversation to collaborators on Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregression

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions