#!/bin/tcsh set input = `head -1` echo $input if ($input == [:alnum:]*.txt) then echo "text file" else echo "not text file" endif