reversing lines in a file
Anw%maths.nottingham.ac.uk at UCL-CS.ARPA
Anw%maths.nottingham.ac.uk at UCL-CS.ARPA
Sat Oct 5 09:58:46 AEST 1985
anw at UK.AC.Nott.Maths
-- Andy Walker, Maths Dept, Nottingham Univ
grep -n "" file.dat | sort -rn | sed "s/[0-9]*://"
Possibly more in the spirit of Unix is
> reverses the lines of file.dat. [...]
>
> % revgrep '^' file.dat
>
> [...] It does a grep, backwards, so
> One way to reverse lines in a file is to use revgrep(1).
More information about the Comp.unix
mailing list