1221345Sdim#!/bin/sh
2218885Sdim#
3218885Sdim# Copyright (c) 2012 Ryan Stone
4218885Sdim# All rights reserved.
5218885Sdim#
6218885Sdim# Redistribution and use in source and binary forms, with or without
7218885Sdim# modification, are permitted provided that the following conditions
8218885Sdim# are met:
9218885Sdim# 1. Redistributions of source code must retain the above copyright
10218885Sdim#    notice, this list of conditions and the following disclaimer.
11218885Sdim# 2. Redistributions in binary form must reproduce the above copyright
12218885Sdim#    notice, this list of conditions and the following disclaimer in the
13218885Sdim#    documentation and/or other materials provided with the distribution.
14218885Sdim#
15218885Sdim# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16218885Sdim# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17249423Sdim# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18249423Sdim# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19218885Sdim# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20243830Sdim# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21243830Sdim# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22218885Sdim# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23218885Sdim# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24218885Sdim# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25218885Sdim# SUCH DAMAGE.
26218885Sdim#
27218885Sdim#
28218885Sdim
29218885Sdimif [ "$#" -ne 2 ]
30218885Sdimthen
31218885Sdim	echo "Usage: make_ktr input output" >&2
32218885Sdim	exit 1
33218885Sdimfi
34218885Sdim
35218885Sdimsort -k 2nrb $1 | cat -n > $2
36218885Sdim
37218885Sdim