LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 03-08-2013, 09:48 AM   #1
Soderlund
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: Slackware
Posts: 98

Rep: Reputation: 42
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.
 
Old 03-08-2013, 10:05 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,112

Rep: Reputation: Disabled
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
 
2 members found this post helpful.
Old 03-08-2013, 10:16 AM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 2,863

Rep: Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698
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.

Last edited by tronayne; 03-08-2013 at 10:18 AM.
 
1 members found this post helpful.
Old 03-08-2013, 10:29 AM   #4
Soderlund
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: 42
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.
 
Old 03-08-2013, 10:45 AM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 2,863

Rep: Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698
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.
 
Old 03-08-2013, 10:53 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 2,863

Rep: Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698
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).
 
1 members found this post helpful.
Old 03-08-2013, 11:50 AM   #7
Soderlund
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: 42
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
Failed to chck remot comnd executin using shells /usr/bin/ssh and /usr/bin/rsh farnaw4u Linux - Software 2 04-06-2009 12:08 AM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration