[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ed proposal - multiple files on command line
From: |
Paul Jackson |
Subject: |
Re: ed proposal - multiple files on command line |
Date: |
Thu, 9 Nov 2006 23:58:52 -0800 |
John wrote:
> I like the feature, but not the syntax. "%" in ex means
> "this file", not "the next file".
Eh - "%" means this file for other commands, the next file for
the 'e' command. In general, it expands to some filename.
If someone wants to have 2 ways to get at this feature, with
':n' or whatever, in addition to the 'e %', that's fine by me.
But every version of ed that I've used heavily since the mid-1980's
has had 'e %' edit the next file. Anytime I get stuck using a version
that lacks this, for more than a quick edit on a foreign machine, I
build my own ed that can do this.
I would find the addition of such a feature to ed that was only
accessible via some other invocation than 'e %' to be personally
useless.
> I'd like to use ed, but there are just enough features that ex has that
> ed does not, that I can't, quite. These are:
>
> ! with a range to process a range of lines through a command;
Yeah - to do that in ed is a bit cumbersome, requiring tmp files.
For example, to "fmt" lines 11,33 of /etc/services (a silly thing
to format this way ;):
$ ed /etc/services
11,33w !fmt > /tmp/x1
11,33d
-r /tmp/x1
< ... > and < commands to indent and unindent, with multiple ones allowed.
Yeah - I keep around a perl script, that I call "I" to indent (or with
an argument outdent), which I filter text through, using tmp files as
above. And I keep around whatever is my favorite text formatting
command of the year in a script I call "F", to format text blocks with
nicely wrapped lines.
Not particularly pretty, I'll agree.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <address@hidden> 1.925.600.0401