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

From: Ronemus AD (Alan) (
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
>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 <>
Jim Harmon <>
Rich Kulawiec <>
Jonathan Loh <>
Charlie Mengler <>
Dan Penrod <>
Glenn Satchell - Uniq Professional Services <>
Kevin Sheehan <>
John Valdes <>
Joseph S. D. Yao <>

     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/

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

                                      Thanks again,

Alan Ronemus Telephone: (304)747-3651
Union Carbide Corporation Facsimile: (304)747-5430
3200 Kanawha Turnpike E-mail:
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