I am learning linux and was given this problem as my homework but i can't solve this that how we can compare two files content in shell mode.
(Here, we can assume that both files having text content like this
cat > f1
this is file 1)
$ cat duplicate_file.sh echo "Enter file 1:" read file1 echo "Enter file 2:" read file2 cmp $file1 $file2 > newfile x=` wc newfile | cut -d" " -f2 ` if [` $x -eq 0 `] then rm -i $file2 fi
I made this program but this isn't working. Any suggestions?