如何在shell脚本中找到匹配数据的两个文件并在shell中的另一个文件中重复存储数据?
#!/bin/bash
file1="/home/vekomy/santhosh/bigfiles.txt"
file2="/home/vekomy/santhosh/bigfile2.txt"
while read -r $file1; do
while read -r $file2 ;do
if [$file1==$file2] ; then
echo "two files are same"
else
echo "two files content different"
fi
done
done
Run Code Online (Sandbox Code Playgroud)
我写了代码,但没有用。怎么写?