#!/bin/sh read MIN while read NUM do [ -z "$NUM" ] && break [ "$NUM" -lt "$MIN" ] && MIN="$NUM" done echo $MIN