flag=1
if [ $# -ne 0 ];then # IF USER PROVIDE ARGUMENTS
echo $* >temp
flag=1
else # IF USER NOT PROVIDE ARGUMENTS
ans=`ls *.c`
if [ "" == "$ans" ];then
echo "THERE ARE NO C FILE"
flag=0
else
ls *.c>temp
flag=1
fi
fi
if [ $flag -eq 1 ];then
for filename in `cat temp`
do
if [ -f $filename ];then
echo "\t\t\t========="
echo "\t\t\t$filename"
echo "\t\t\t========="
echo " "
sed -n -e "1,10 p" $filename
rm -i $filename
fi
done
rm temp
fi
No comments:
Post a Comment