#!/bin/tcsh

#This code takes a directory name and outputs the number of "actual" files in the directory. It also descends into the 
# subdirectories if any until it reaches a files. 
#This code takes input from the keyboard until the user types q

while(1)
    echo -n "Please give a directory pathname: "
	set arg = `head -1`
    echo "Directory name is: $arg"
	if($arg == q) then       #If user types q then exit
		exit
	endif

	if(!(-e $arg)) then
	    echo "File does not exist"
	else  
	    echo "No of files = `find $arg -type f | wc -l`"
	endif
end

