In bash one can write
CFLAGS="-O2" rvm install 2.0.0
to run rvm
with that specific CFLAGS
. Is there anyway to do the same in fish
shell?
I know about set -x
but that is not exactly the same as the environment variable will be set for the whole session instead of just for that command.
According to the fish FAQ, either use:
env CFLAGS="-O2" rvm install 2.0.0
(which will not work for fish builtins or functions, only external commands), or
begin
set -lx CFLAGS="-O2"
rvm install 2.0.0
end
(which is a little clunky; there are proposals for improvement on GitHub issue #438).