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