SUMMARY: Text Editor in SunOS 4.1.{3,4} Mini-Root?

From: Ronemus AD (Alan) (ronemuad@ucarb.com)
Date: Mon Nov 10 1997 - 15:14:36 CST


My original Message:

> In the course of restoring a crashed system, I recently needed a
>text editor while running the mini-root from the SunOS 4.1.4
>installation CD. I couldn't execute ed, ex, or vi. Does anbody know
of
>a text editor hidden in there somewhere? It would certainly be useful
>for changing configurations, as in editing /etc/hosts to allow rrestore
>to use a remote tape drive.

     Thanks to all who replied:

Shriman Gurung <SG@datcon.co.uk>
Jim Harmon <jharmon@telecnnct.com>
Rich Kulawiec <rsk@itw.com>
Jonathan Loh <jloh@futon.sfsu.edu>
Charlie Mengler <charliem@anchorchips.com>
Dan Penrod <dan@paradyne.com>
Glenn Satchell - Uniq Professional Services <Glenn.Satchell@uniq.com.au>
Kevin Sheehan <Kevin.Sheehan@uniq.com.au>
John Valdes <valdes@macavity.uchicago.edu>
Joseph S. D. Yao <jsdy@cais2.cais.com>

     The concensus was to use cat, with the output directed to a file.
Several people suggested using head and/or tail with I/O redirection to
edit the contents of a file. A more elegant solution was suggested by
Shriman Gurung, who wrote:

>I dont know about SunOS, but for a generic unix, how about a shell
>script function like this:
>
># edit() {
> while read input
> do
> echo $input > /dev/tty
> read newline < /dev/tty
> if test "$newline"
> then
> echo "$newline"
> else
> echo "$input"
> fi
> done
> }
>
>which you'd use by typing something like
>
>edit < /etc/hosts > /etc/hosts.new

Of course, you'd need to use cat to enter the script in the first place.

                                      Thanks again,
                                      Alan

Alan Ronemus Telephone: (304)747-3651
Union Carbide Corporation Facsimile: (304)747-5430
3200 Kanawha Turnpike E-mail: ronemuad@ucarb.com
P. O. Box 8361
South Charleston, West Virginia 25303



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:08 CDT