#!/bin/sh for f in output-[0-9]*-[0-9]*; do echo $(echo $f | sed -e "s/output-\\([0-9]*\\)-.*/\\1/") $(grep Times: $f) done | sort -n