Mail Archives: djgpp/2010/04/25/10:45:14
Hi,
On Apr 24, 6:32=A0pm, "Rod Pemberton" <do_not_h DOT DOT DOT AT havenone DOT cmm> wrote:
> "Eli Zaretskii" <e DOT DOT DOT AT gnu DOT org> wrote in message
>
>
> > VI and EDIT are unrelated to Sed.
>
> So?
VI typically is the same binary as EX, which is an improved ED. And
both GREP and SED were derived from ED. Besides, ED was indeed used
for scripting via redirection, but for files larger than memory, it
was necessary (or preferred?) to read a line at a time instead. *BSD
uses NVI (heavily-modified from early Elvis) and OS/2 has a port while
Linux and Mac OS X use VIM (heavily modified from early SteVIe).
Others available are Calvin, XVI, and VILE. (Heck, grab the true
original at http://ex-vi.sf.net )
> > Sed is a _stream_ editor, it edits
> > files in batch mode, not interactively.
> > It is suitable for scripts
> > that need to edit text.
>
> Which is much like, if not the same as, what I mentioned that I did [you
> snipped] by generating AWK scripts from VI commands... =A0Yes?
VI can use scripts too, it supports the ":source" EX command. VIM even
has EXIM.
> Except for command line issues, the Sed command the OP posted is the
> same as the EX/ED commands in VI. =A0He could do the same for them: gener=
ate
> AWK scripts from Sed commands, manually or programmatically. =A0Using AWK
> could possibly provide an improvement in processing speed. =A0I've seen A=
WK
> and VI on every non-Windows machine I've ever used, including the
> non-Unix/Linux ones where you wouldn't expect to seen them.
Typically, I think sh and AWK were the only scripting tools available
on *nix. Of course, that's changed now. I don't think AWK (directly)
supports in-place editing, which GNU sed 4.x gleaned from Perl
anyways. But yes, AWK is nice, and Kernighan still maintains his
version (one true AWK), which is what *BSD uses these days. It even
compiles with DJGPP (I didn't kick it too hard, don't really know AWK,
but it seemed to work).
"Updated February 8, 2010"
http://www.cs.princeton.edu/~bwk/btl.mirror/
P.S. Rod, why not use VIM or VILE if your 16-bit version runs out of
RAM? Oh, and AWK doesn't look too "convoluted", see the GAWK manual
(quite large and nice!). Or see Eric Pement's AWK cheatsheet / one-
liners:
http://invisible-island.net/vile/
ftp://invisible-island.net/vile/vil97dos.zip
ftp://invisible-island.net/vile/vile.tar.gz
http://www.gnu.org/software/gawk/manual/
http://www.pement.org/awk.htm
http://www.pement.org/awk/awk1line.txt
http://www.pement.org/awk/awk_sed.txt
- Raw text -