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
Support commandline local variables #1377
Comments
@zanchey What is the official position on this? If I sum-up the threads:
|
env is an external command, so it can't do things like modify the value of a variable before it gets expanded. This is one of many reasons why it's an imperfect substitute for the foo=bar syntax in POSIX shells. This is obviously a very popular request, but the If you agree this is the same as #438, I'd like to close as a dup of that. |
I agree, but 1) the solution proposed does not work (and the faq neither) 2) I am sure we can find an easy way to work around this. What about an extra flag to |
Here is the right way: set var hello
function fcn -S
echo $var
end
begin
set -l var world
echo $var
fcn
end By default function doesn't see outer scope local variables. |
Let's track in #438 |
It would be nice to have the ability to set a temporary environment variable.
Right now, in order to do this, I have to write;
set -x VAR value; cmd; set -e VAR
.In any other shell, you can do this:
VAR=value cmd
Fish is not any other shell, I know.. But I don't think it is a reason to strip must have features like this ;)
The text was updated successfully, but these errors were encountered: