#!/bin/echo Source me: .
#
# Copyright (c) 2002-2004 by Frederick Bruckman
# All rights reserved.

# The function takes two arguments:
#
#     Argument #1: the name of the file with the sorted keys
#     Argument #2: the name of the file to sort
#
# The sorted contents of the second file go to standard out.
#
sort_with () {
	awk '
		FNR == NR {
			alldirs[$1] = $0
		}
		FNR != NR {
			if ($1 in alldirs)
				print alldirs[$1]
		}
	' "$2" "$1"
}
