in reply to (GOLF) Randomizing lines


This will always randomise in the same way, which probably isn't what you want. Also, some lines might be lost if the file contains duplicate lines. However it is short.

22 chars:
perl -e'%_=<>;print%_' file


John.
--

Replies are listed 'Best First'.
Re: Re: (GOLF) Randomizing lines
by petral (Curate) on Jul 26, 2001 at 20:25 UTC
    Then why not:perl -e'print%{{<>}}' ?  (21 chars )
    (and it's pretty), (and, as with the other, it even gets rid of duplicate odd-numbered lines (and the following line) for you.)

      p