Shell Programming Question - sort

Maarten Litmaath maart at cs.vu.nl
Sat Mar 3 17:52:09 AEST 1990


In article <751 at ncs.dnd.ca>,
	marwood at ncs.dnd.ca (Gordon Marwood) writes:
)I am trying to sort (using "sort" in Ultrix) based on the last two
)characters in a line (which are numeric).  There are a variable number
)of characters in a line, and these last two characters are preceded by a
)space, [...]

sed 's/\(.*\) \(..\)$/\2 \1/' | sort | sed 's/\(..\) \(.*\)/\2 \1/'
--
  "Belfast: a sentimental journey to the Dark Ages - Crusades & Witchburning
  - Europe's Lebanon - Book Now!" | maart at cs.vu.nl,  uunet!mcsun!botter!maart



More information about the Comp.unix.questions mailing list