Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In bash, I can do EDITOR=vim crontab -e. Can I get similar effect in Fish shell?

share|improve this question

2 Answers 2

up vote 15 down vote accepted
begin; set -lx EDITOR vim; crontab -e; end
share|improve this answer
1  
is there any easier way to do this? –  Milovan Zogovic Oct 29 '12 at 8:43
    
oddly, this doesn't work for me. I'm calling a ruby script, and ENV doesn't pick up the variable I'm setting: set -lx date '12/04/2012' –  Duke Dec 7 '12 at 23:13
    
@Duke: It works for me. begin; set -lx date '12/04/2012'; ruby -e 'puts ENV["date"]'; end –  Dennis Williamson Dec 8 '12 at 0:49
5  
In the meanwhile this has been answered in the Fish FAQ: fishshell.com/docs/current/faq.html#faq-single-env –  harm Apr 3 at 9:09

Don't see why this shouldn't work: env EDITOR=vim crontab -e
That bypasses the shell completely.

share|improve this answer
1  
This is so much easier. The only problem is that bypassing the shell disallows any custom fish commands, which are probably locked in your muscle memory. –  JohnMetta Jun 3 '13 at 20:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.