Skip to content

Fails with nested use of backquotes #98

Description

@rpmoseley

If you try to parse the following command:

suser=expr "\id`" : '(uid=0)(.) .'`

this will fail with the following exception:

bashlex.tokenizer.MatchedPairError: unexpected EOF while looking for matching '"' (position 7)

After some investigation, it was found to be the adjustment made when a backquote is found within the function '_stringextract' in module 'subst.py', it will incorrectly only skip the backquote itself, not the following character as well.

The simple solution is to increment the variable by 2 instead of 1, this will then handle the parsing correctly.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions