* (no subject)
@ 1993-02-22 4:48 rob
1993-02-23 3:26 ` David Hogan
0 siblings, 1 reply; 2+ messages in thread
From: rob @ 1993-02-22 4:48 UTC (permalink / raw)
To: sam-fans
How about:
y/^ +/ x/ +/ c/ /
that's using ^ again; i thought the exercise was to avoid it.
at least, that is the exercise i've been working on.
when i made my suggestion
x s2/ +/ /g
i implicitly assumed, as i think did the original poster, that
each line began with white space. as i sit here now, i can't
find a clean-enough-to-use version that doesn't use ^. the
magic thing about ^ is that it works at the beginning of the file;
otherwise i could cheat. the poster said he had whole lines, hence:
-#1,. x/\n?.+/ v/\n/ x/ +/ c/ /
but this is already too silly.
-rob
^ permalink raw reply [flat|nested] 2+ messages in thread
* (no subject)
1993-02-22 4:48 rob
@ 1993-02-23 3:26 ` David Hogan
0 siblings, 0 replies; 2+ messages in thread
From: David Hogan @ 1993-02-23 3:26 UTC (permalink / raw)
To: sam-fans
> From: rob@research.att.com
> y/^ +/ x/ +/ c/ /
> that's using ^ again; i thought the exercise was to avoid it.
> at least, that is the exercise i've been working on.
I thought the point was to avoid using it in sub-commands. Although
the command we are trying to find might have to be the sub-command of
another x command, I suppose.
> when i made my suggestion
> x s2/ +/ /g
> i implicitly assumed, as i think did the original poster, that
> each line began with white space.
>[...]
Hmmm, I missed that when I first read the post.
Anyway, here's another way to do it:
x/[^ ].*/ s/ +/ /g
(Dang! That ^ is unavoidable :-)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1993-02-23 3:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-02-22 4:48 rob
1993-02-23 3:26 ` David Hogan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).