Hi Suresh ,
Whenever we will create a file using Cat Coommand,or ed command,or Vi file name...............
We check whether it is create successfully or not using the command
echo $?
if returns 0 then it create successfully
if returns non zero value not create .....
Regards
Jahid