[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Editor Documentation

On 17:57 21 Mar 2003, Wolfgang Gill <wolfgang botanybay nsw gov au> wrote:
| Can anyone tell me or point me in the right direction as to where to get
| hold of some editor documentation. Either in HTML or PDF format.
| What I basically would like to do, is to write some *.sh scripts. And use
| the editor commands to edit some text files (Command line based). I want to
| be able to search for text, and either add text to the file (in the correct
| area), or remove the text and/or replace the text in the file using a
| script. 
| This will mainly be used for updating drivers and update pack files which
| will also require the editing of text or *.ini files etc.
| I've read some scripts which use 'ed' but I'm unable to get hold of a
| detailed, printable document on it's commands and features. (And not to
| mention some good examples of how they can be used in a command line basis).

To use ed in command line mode you go:

	ed - filename <file-with-ed-commands
	ed - filename <<'X'

to use a shell here-document.

| I've found some commands which will partly do what I need it to. But it
| doesn't work 100% the way I'd like. And getting more detailed information on
| it will help greatly.

For this kind of thing I usually use bsed:


which is a wrapper for sed that edits in place. Example:

	bsed 's/this/that/' filename

You invoke it just just sed except that it edits files instead of acting
as a filter. The manual for sed ("man sed") describes all the commands in
detail, and sed's command set is very much like ed, so you will already
be somewhat familiar with it.

Cameron Simpson, DoD#743        cs zip com au    http://www.zip.com.au/~cs/

Try moving off NT easily.  You can move from Solaris to HP/UX to AIX or
DEC easily-- relative to moving off of NT, which is like a Roach
Motel.  Once you check in, you never check out.
	- Scott McNealy, Sun Microsystems

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]