#! /usr/bin/bash for f in $* ; do cat $f 2> /dev/null if [ $? -ge 1 ]; then echo "Invalid file: $f" fi done