Swap variable overrides and time in not statement#10890
Closed
krobelus wants to merge 1 commit into
Closed
Swap variable overrides and time in not statement#10890krobelus wants to merge 1 commit into
krobelus wants to merge 1 commit into
Conversation
This is allowed time a=b echo 123 but -- due to an oversight in 3de9503 (Make "time" a job prefix, 2019-12-21) -- this is not allowed: not time a=b echo 123 Instead, this one one works: not a=b time echo 123 which is weird because without the "not" this would run "/bin/time". It seems wrong that "not" is not like the others. Swap the order for consistency.
faho
pushed a commit
to faho/fish-shell
that referenced
this pull request
Dec 26, 2024
This is allowed time a=b echo 123 but -- due to an oversight in 3de9503 (Make "time" a job prefix, 2019-12-21) -- this is not allowed: not time a=b echo 123 Instead, this one one works: not a=b time echo 123 which is weird because without the "not" this would run "/bin/time". It seems wrong that "not" is not like the others. Swap the order for consistency. Note that unlike "not", "time" currently needs to come before variable assignments, so "a=b time true" is disallowed. This matches zsh. POSIX shells call "/bin/time" here. Since it's ambiguous, erroring out seems fine. It's weird that we're inconsistent with not here but I guess "command not" is not expected to have subtly different behavior. Closes fish-shell#10890
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is allowed
but -- due to an oversight in 3de9503 (Make "time" a job prefix,
2019-12-21) -- this is not allowed:
Instead, this one one works:
which is weird because without the "not" this would run "/bin/time".
Swap the order for consistency.