LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Is it safe to remove /usr/bin/ex and /usr/bin/vi? (http://www.linuxquestions.org/questions/slackware-14/is-it-safe-to-remove-usr-bin-ex-and-usr-bin-vi-4175453275/)

Soderlund 03-08-2013 09:48 AM

Is it safe to remove /usr/bin/ex and /usr/bin/vi?
 
The SlackBook says I can change /usr/bin/vi to point at vim instead of elvis, so I assume it's safe to remove that one.

What about /usr/bin/ex?

Does any program, like for example visudo, depend on these being present, or require them to point at elvis/vim?

The idea is to install another version of ex and vi in /usr/local/bin/, and to remove the old ones from /usr/bin/. Then when I type in "vi" it should resolve to "/usr/local/bin/ex -v" instead of "/usr/bin/elvis" since they are both in PATH.

I'm just a little nervous because elvis is in A and it says it's a required package because it's the default vi. Can this break anything?

Thanks in advance.

Alien Bob 03-08-2013 10:05 AM

As far as I know, there is no Slackware script or tool which depends on the existence of either vi or ex. Well, if you want to edit your crontab file or the sudoers file, you'll have to be sure to set an EDITOR variable if "vi" is unavailable. Perhaps there are other corner cases, but those are all for interactive work anyway, and you can work around that yourself.

Eric

tronayne 03-08-2013 10:16 AM

Safe to remove? Hm. Probably no good reason to do so -- just
Code:

su -
rm /usr/bin/vi
ln -s /usr/bin/vim /usr/bin/vi

The vi in /usr/bin defaults to a symbolic link to /usr/bin/elvis and you are free to change that as above.

In its original incantation vi actually is ex (that would the Unix ex). vi is just the visual mode of ex. In your Slackware implementation, ex is a symbolic link to /usr/bin/vim (probably don't want to remove it) so, when you type ex, you're getting vim in non-visual mode.

If you really want original ex (so you have original vi), go to http://heirloom.sourceforge.net/index.html, download the source and build it (it's actually kind of neat software).

Basically, it ain't broke, don't fix it, eh?

Hope this helps some.

Soderlund 03-08-2013 10:29 AM

Thank you very much.

It is Gunnar Ritter's ex port, tronayne. It will be like this:

Code:

/usr/local/bin/ex # ex-vi binary
/usr/local/bin/vi # symlink to "ex -v"

I will do as you suggested and symlink /usr/bin/vi to /usr/local/bin/vi and /usr/bin/ex to /usr/local/bin/ex too.

Very good. Flagging it as solved.

tronayne 03-08-2013 10:45 AM

Yep, it's Gunnar's port -- seems like his web site went somewhere or other a few years ago (last time I looked anyway) and the software got handed to the Heirloom Project (pretty sure, not positive).

I still run his lex (because the GNU version just doesn't like to do some lex files I have laying about that I don't really want to port to flex.

He did some nice work.

tronayne 03-08-2013 10:53 AM

I forgot to mention -- if you want real nawk (the Aho, Kernighan, Weinberger original), Brian Kernighan makes the current source code available at this web site at Princton: http://www.cs.princeton.edu/~bwk/. Compiles and runs just fine in Slackware (and, frankly, I think it's a better implementation than gawk, just my opinion).

Soderlund 03-08-2013 11:50 AM

Cool, thanks for the link. I always avoided the gawk extensions so it wouldn't affect my scripts, but maybe something else depends on them.

You are right: if it isn't broken it shouldn't be fixed. Lack of updates for several years doesn't necessarily indicate a problem -- on the contrary, it may mean that the program is so well-written that there have been no bugs during that time. I think that is the case with this port of vi, and probably nawk too. Vim will always keep evolving, adding more and more complexity and therefore more bugs, while vi ages like wine.


All times are GMT -5. The time now is 09:24 AM.