I've just noticed that when I call fc
, I got the following error message:
zoltan@adrian ~ $ fc
bash: vi: command not found
The which command returns a similar result:
zoltan@adrian ~ $ which vi
which: no vi in (...intentional omission...)
The strange part of it is that I always just type "vi" when I use an editor. I've set up an alias in my .bashrc which will alias "vi" to "vim".
Could you provide an explanation why is this the case? Is it possible that these (built-in) commands open a subprocess with a non-bash shell, even if it is called from bash?
Is there any better workaround than putting a link named vi
, which points to vim
?
which
doesn't know anything about shell aliases, functions, or builtins; usetype
instead.