shell pipeline to reverse the order of lines.

Tom Chapin chapin at cbnewsc.att.com
Wed Feb 27 03:38:13 AEST 1991


Brandon S. Allbery writes:
>I don't understand what's wrong with
>	nl | sort -nr | cut -f2-

NL doesn't automatically number blank lines, so a more bulletproof
version would be:

	nl -ba | sort +0nr -1 | cut -f2-

or one might even try:

	nl -ba | sort +0nr -1 | newform -l1 -b7


-- 
     tom chapin                att!hrccb!tjc         tjc at hrccb.att.com



More information about the Alt.sources.d mailing list