
请帮忙看看下面这段script,是想递归比较一个目录下的所有文件是否相同,但是运行失败了,错误提示是一堆command not found。
#!/bin/bash
for i in *
do
for j in *
do
if $i != $j
then
if cmp $i $j| head -1 != 0
then
cmp $i $j|head -1>>filecompresult
fi
fi
done
done
错误提示:
./filecomptest: line 7: 黄金九岁探弋.rm: command not found
请问应该怎么写?是不是diff,cmp等不能在script中用?