On Thu, 13 Mar 2003 11:50:23 +0200 (EET)
Tuomo Salo <[EMAIL PROTECTED]> wrote:
> #!perl -p0
> s#^(\S* )(.*)\n\1#$1$2 #m&&redo
>
> If the input contains no duplicate lines, the "\S*" can be replaced with ".*".
> Using a literal newline would shave yet another stroke.
#!perl -p0
s/^((\S+).+)\n\2/
On Thu, 13 Mar 2003 16:14:21 +0100
Marius Ascheberg <[EMAIL PROTECTED]> (I) wrote:
> #!perl -p0
> s/^((\S+).+)\n\2/$1/m&&redo
Sorry, but this is just wrong.
It handles
a a
ab a
wrong.
So we're back to 32 strokes.
#!perl -p0
s/^((\S+).+)\n\2 /$1 /m&&redo
On Thu, 13 Mar 2003 17:20:00 +0100
Marius Ascheberg <[EMAIL PROTECTED]> (I) wrote:
> So we're back to 32 strokes.
>
> #!perl -p0
> s/^((\S+).+)\n\2 /$1 /m&&redo
I was too dumb, again.
So here's my last one, which seems to work and uses 33 strokes:
#!perl -p0
s/^((\S+) .+)\n\2 /$1 /m&&redo