#!/bin/tcsh set files = ( * ) set oldest = $files[1] shift files foreach fname ( $files ) if ( -M $fname < -M $oldest ) set oldest = $fname end echo "oldest file is" $oldest