Reversing a file?

Herwig Henseler henseler at uniol.UUCP
Fri Oct 6 21:17:54 AEST 1989


montnaro at sprite.crd.ge.com (Skip Montanaro) writes:
> Does somebody have an elegant shell script for reversing the lines of a
> file?

The solution in perl:

@file = <>;
$i = $#file + 1;
print $file[$i]  while $i--;

	bye, Herwig
--
## Herwig Henseler (CS-Student) D-2930 Varel, Tweehoernweg 69 | Brain fault- ##
## EMail: henseler at uniol.UUCP (..!uunet!unido!uniol!henseler) | core dumped  ##



More information about the Comp.unix.questions mailing list