From owner-freebsd-questions@FreeBSD.ORG Fri May 15 07:41:02 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E071106568D for ; Fri, 15 May 2009 07:41:02 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id F11798FC20 for ; Fri, 15 May 2009 07:40:59 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id n4F7exKq099074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 15 May 2009 00:40:59 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id n4F7exur099073; Fri, 15 May 2009 00:40:59 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA28624; Fri, 15 May 09 00:30:33 PDT Date: Fri, 15 May 2009 00:30:15 -0700 From: perryh@pluto.rain.com To: invalid.pointer@gmail.com Message-Id: <4a0d1a07.fZIhzrRdPEy8LIdq%perryh@pluto.rain.com> References: <200905142019.56242.mel.flynn+fbsd.questions@mailing.thruhere.net> <4A0D0FD6.4040107@gmail.com> In-Reply-To: <4A0D0FD6.4040107@gmail.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: How to move vi to /bin X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2009 07:41:11 -0000 Manish Jain wrote: > From all the discussion I have walked through on the issue of > where to place vi, it does appear FreeBSD has a skewed policy > on the issue. There are plenty of reasons you might need access > an editor in single-user mode - editing fstab is just one. > Having to use the workarounds suggested in place of vi is not > so good, and manually moving vi to /bin is not simply a matter > of 'mv /usr/bin/vi /bin/'. > > One of the things I would dearly like to see in a future release > is vi being placed under /bin. Maybe put something like this [untested] in /bin/vi: #!/bin/sh [ -x /usr/bin/vi ] && exec /usr/bin/vi "$@" exec /rescue/vi "$@" That should run /usr/bin/vi if it's available, else fall back to /rescue/vi. Beats linking /rescue/vi into /bin, since that would cause the statically-linked version to be used by anyone who has /bin ahead of /usr/bin in PATH, even when the dynamically-linked version is available.