[SOLVED] Is it safe to remove /usr/bin/ex and /usr/bin/vi?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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).
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.