#!/bin/bash #recmerge 0.2 (C) 2003 Stanislav Traykov [terms of use: NetHack GPL] u="usage: recmerge [maxUserRole=3] [maxScores=100]" sort -k2nr -k9n ${1?$u} ${2?$u} | while read -raA; do r=${A[11]}${A[10]}; let $r=${!r}+1 [ ${!r} -le ${3:-3} ] && echo "${A[*]}" done | head -n${4:-100}