Skip to content

Parser bug with command substitutions in strings inside parenthesis #8500

@Darkshadow2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intendedregressionSomething that used to work, but was broken, especially between releases

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions