Fails with nested use of backquotes
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.
Hi, thanks for the report. Do you mind sending a pull request, with a few tests?
Hi, apologies for the time take to get back to you. I have been spending some time, deciding whether to make changes to ensure that the AST produced by backquotes is the same as is currently done for the use of $(...) before submitting the pull request. Also, I'm having trouble getting the test to pass, it seems to think that there are differences even though the AST looks correct to me.