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

RE: Editor Documentation



Thanks I'll check it out

Wolf


-----Original Message-----
From: Cameron Simpson [mailto:cs zip com au] 
Sent: Friday, 21 March 2003 1:39 PM
To: psyche-list redhat com
Subject: 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
    or
	ed - filename <<'X'
		ed
		commands
		...
	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:

	http://www.cskk.ezoshosting.com/cs/scripts/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.

Cheers,
-- 
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



-- 
Psyche-list mailing list
Psyche-list redhat com
https://listman.redhat.com/mailman/listinfo/psyche-list

######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################





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