5 ms·
As a long time bash user, I thought I can give a chance to fish. But after 30m later, when I see this [1] I went back to bash. [1] http://serverfault.com/quest
by sepeth 13y ago
As a long time bash user, I thought I can give a chance to fish. But after 30m later, when I see this [1] I went back to bash.
[1] http://serverfault.com/questions/164305/how-can-i-set-environment-variable-for-just-one-command-in-fish-shell http://serverfault.com/questions/164305/how-can-i-set-enviro...
- andrewvc 13y agoWhat's so hard about typing 'env' in front of the line? `env EDITOR=vim crontab -e` Also, why are you changing your EDITOR on a one-off basis, that shit should be permanent.
- sepeth 13y agoAh! you are right. That didn't occur to me, when I was trying fish. BTW, My point is not specific the EDITOR variable.
- owenjones 13y agoThat question was asked 2 years ago. From the current docs: A universal variable is a variable whose value is shared across all instances of fish, now and in the future - even after a reboot. You can make a variable universal with set -U: > set -U EDITOR vim Now in another shell: > echo $EDITOR vim
- sepeth 13y agoMy problem is not specific to EDITOR variable. E.g. sometimes I need to set PYTHONPATH per specific command. What irritates me is that the syntax to do that. I am not asking for a way to make a variable universal, I am looking for a way to specify variable per command.
- zach 13y agoThis is very nearly a deal-breaker for me, and the current response is typically "yeah, it's verbose, deal with it": https://github.com/fish-shell/fish-shell/issues/587 https://github.com/fish-shell/fish-shell/issues/587 I use Rails with rbenv, a common package which adds shell commands to control which version of Ruby is used. There is a fish port of it, so when you run the very common command "rake" it invokes a fish function which sets up the right environment. And when you do run rake, you often need to set environment variables to set one-time options for the procedure you're invoking. Now the trap is set for the would-be fish user. Because you're actually using the fish shell to customize a command, you can't just punt to env with "env VERSION=20130411222645 rake db:migrate:down" because you actually want to run the fish function, not an executable. So for now, I'm setting environment variables at the command line and unsetting them afterwards. It's really getting old, especially because it loses context in my command history. I think I'll probably ditch fish if I can't find a workaround for this, so any suggestions are appreciated.