On 11:01 14 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote: | On Mon, 2003-01-13 at 13:18, Samuel Flory wrote: | > [EMAIL PROTECTED] wrote: | > >or try: | > >:g/abdfggg/s//opsmsdd/g from vi/vim | > | > That's really the hard way. | > :%s/abdfggg/opsmsdd/g works just as well and makes more sense. | | This is the vi syntax I am familier with. What is the first example | doing?
It's a lesser known syntax, but valid all the way back to e and ed. It separates selection from operation. It says, "globally, for all lines containing abdfggg, substitute that (// being 'that') with opsmsdd". You can do more flexible things, like: g/foo/ .-2,.+2m0 or g/bah/ s/this/that/g and so forth. -- Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/ Government is not reason. It is not eloquence. It is a force, like fire, a dangerous servant and a terrible master. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list