#!/bin/ksh #Sort playing cards, one per line, in order of increasing rank. #Ignore the suits. #Add "14 " to start of every line that begins with "A" or "a". #See bystanders in Handout 8, p. 6, column 2. #For & in an s/// command, see Hand 8, pp. 6-7; textbook pp. 323-324. sed ' s/^[2-9]/& &/ s/^10/& &/ s/^[Jj]/11 &/ s/^[Qq]/12 &/ s/^[Kk]/13 &/ s/^[Aa]/14 &/ ' | sort -n | sed 's/^[^ ]* //' #Remove everything up to & including 1st blank. exit 0