echo"enter first file"
read file
echo"enter second file"
read file1
if [-f $ file]
then
if[-f $file1]
then
cmp $file $file1
if [$? -eq u]
then rm $file1
echo"both are same"
echo"deleted second file"
else
echo"files are not similar"
fi
fi
fi
- List item
[
and]
test operators need white space around them:[ -f "$file" ]
and so on – steeldriver Feb 07 '17 at 19:00if [-f $ file]
what is that supposed to do?if [ -f $file ]
– Rinzwind Feb 07 '17 at 20:47