-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"for" does not validate variable names #5800
Labels
bug
Something that's not working as intended
Milestone
Comments
List of invalid characters that
So, basically all of them, and in any position (for example |
0ion9
changed the title
"for" accepts and uses invalid variable names
"for" does not validate variable names
Apr 8, 2019
Yeah, that's a bug. It actually is created, too, neat:
|
fixed: $ for a,j in i v; echo foo; end
fish: invalid var name: a,j
for a,j in i v; echo foo; end
^ |
zanchey
added a commit
that referenced
this issue
Apr 9, 2019
zanchey
added a commit
that referenced
this issue
Apr 9, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
for a,b in y 1 z 3; echo $a,$b; end
Expected result: either an error or (ideally) setting a=y b=1, iterating once, then setting a=z b=3; printing each of those pairs on its own line.
Actual result: 4 blank lines
Proof of what is actually happening:
for a,b in y 1 z 3; set -l; end
Result:
In other words,
for
is assigning to a variable named "a,b".This variable cannot be expanded (
echo $a,b
expands correctly to nothing ($a is not set, and therefore the product of it with ",b" is nothing)), nor can the user set, query, or erase this variable.fish version 3.0.2-824-gbf40f84b0
The text was updated successfully, but these errors were encountered: