in reply to help writing simple perl script

This seems to work.

sed 'N;s/\n/ /' list.txt
To make it portable, you may need to replace ; with a newline, and possibly \n with some more portable thing to match a newline.

Update: indeed, this is a wrong solution. I didn't read the OP carefully. Sorry.

Update: \n is said to be portable.

Replies are listed 'Best First'.
Re^2: help writing simple perl script
by ashylarry (Initiate) on Jul 27, 2006 at 16:23 UTC
    thanks but that's not quite what I needed. It has to be "N-by-N", and that simply pairs the 1st with 2nd, 2nd with 3rd, 3rd with 4th, etc. I need to pair the 1st against the 2nd through N. The 2nd against the 3rd through N, etc.