From owner-freebsd-questions@FreeBSD.ORG Thu Dec 2 03:27:59 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3EE7B16A4CE for ; Thu, 2 Dec 2004 03:27:59 +0000 (GMT) Received: from mta13.adelphia.net (mta13.adelphia.net [68.168.78.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A19843D53 for ; Thu, 2 Dec 2004 03:27:58 +0000 (GMT) (envelope-from parv@chvlva.adelphia.net) Received: from default.chvlva.adelphia.net ([69.160.67.225]) by mta13.adelphia.netESMTP <20041202032757.KUZB12490.mta13.adelphia.net@default.chvlva.adelphia.net>; Wed, 1 Dec 2004 22:27:57 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 24DE0569F; Wed, 1 Dec 2004 22:27:52 -0500 (EST) Date: Wed, 1 Dec 2004 22:27:52 -0500 From: Parv To: "Kevin D. Kinsey, DaleCo, S.P." Message-ID: <20041202032751.GA552@moo.holy.cow> Mail-Followup-To: "Kevin D. Kinsey, DaleCo, S.P." , Trey Sizemore , freebsd-questions@freebsd.org References: <41AA5AFC.2090902@fastmail.fm> <20041128201638.N66254@cactus.fi.uba.ar> <41AA663F.2030106@fastmail.fm> <41AE5BB9.1000902@daleco.biz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41AE5BB9.1000902@daleco.biz> cc: Trey Sizemore cc: freebsd-questions@freebsd.org Subject: Re: How to edit file in single user mode X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: f-q@chvlva.adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 03:27:59 -0000 in message <41AE5BB9.1000902@daleco.biz>, wrote Kevin D. Kinsey, DaleCo, S.P. thusly... > > >>On Sun, 28 Nov 2004, Trey Sizemore wrote: > >> > >>>I made a typo in rc.conf and now am able to boot only into single user > >>>mode. I thought vi would be available to edit the file, but cannot > >>>execute it (vi not found). > > What if you can't mount /usr ? then you've even more trouble. > You can learn to use ed(1), but that's like going back thirty > years. Key is to learn some ed before the actual need arises. Else, frustration lies the other way. > There was some discussion ... on the idea of building a small > editor binary that you like ... and cp'ing it to /bin in > preparation Remember to link your favourite editor statically before even bother to copy. Currently, ee is linked here (4.10-p4) to ... libncurses.so.5 => /usr/lib/libncurses.so.5 (0x28073000) libc.so.4 => /usr/lib/libc.so.4 (0x280b5000) Whatever happens to the editor, it needs to be self contained/sufficient by being small, statically compiled, and be usable w/o the facility of curses. That reminds me of my old C++ class editor project. My version of the editor -- ed like commands, no regex support, menu driven -- statically compiled w/ GCC 3.4 & stripped takes 403 kB (-O1) or 389 kB (-O2). (It has yet to go through a thorough review though. Anybody care to take a look?) I suppose i could/should save a copy just in case. - Parv --