#
#Write  a  script  that  behaves  both  in  interactive  and  non-interactive  mode.  When  no  arguments  are 
#supplied, it picks up each C program from current directory and lists the first 10 lines. It then prompts 
#for deletion of the file. If the user supplies arguments with the script, then it works on those files only.
#
clear

args=$#

if [ $args -eq 0 ] 
then
    for i in $(find . -name "*.txt")
	do
		echo "$(sed -n '1,10p' $i)"
		rm -i $i
	done
else
	for i in $*
	do
		if [ ! -f $i ]	
		then
			echo "File $i does not exist"
		else
			echo "$(sed -n '1,10p' $i)"
			rm -i $i
		fi
	done
fi