You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing a strange bug with variable assignments
>>>list(bashlex.split("PATH=\"$PATH:/usr/local/bin/\""))
['PATH="$PATH:/usr/local/bin/"']
^^# note the quote marks />>>list(bashlex.split("PATH2=\"$PATH:/usr/local/bin/\""))
['PATH2=$PATH:/usr/local/bin/']
# the quote marks are gone!
In the above example, it seems to be the number in the env var name that triggers the removal of quotes.
The following example shows that a preceeding var assignment with a number in the name will trigger the different quote behaviour.
>>>list(bashlex.split("VAR_ABC=1 PATH=\"$PATH:/usr/local/bin/\""))
['VAR_ABC=1', 'PATH="$PATH:/usr/local/bin/"']
^^# note the quote marks />>>list(bashlex.split("VAR_123=1 PATH=\"$PATH:/usr/local/bin/\""))
['VAR_123=1', 'PATH=$PATH:/usr/local/bin/']
# the quote marks are gone!
Retaining the quotes is desirable for my use case. I can workaround, so I'm just wondering if this is a bug in bashlex or some strange bash behaviour.
The text was updated successfully, but these errors were encountered:
Huh, that's weird. Usually what I've done in cases like this is step through bash's source code and see how it parses it compared to bashlex. Then fixing it becomes easier.
I'm seeing a strange bug with variable assignments
In the above example, it seems to be the number in the env var name that triggers the removal of quotes.
The following example shows that a preceeding var assignment with a number in the name will trigger the different quote behaviour.
Retaining the quotes is desirable for my use case. I can workaround, so I'm just wondering if this is a bug in bashlex or some strange bash behaviour.
The text was updated successfully, but these errors were encountered: