Perl,shell, Js比较文件

shell:

    diff $file1 $file2 > /dev/null   # diff 比较文件
    if [ $? != 0 ]  # $? 接收上一条命令的返回值
    then
        echo "Different!"
    else
        echo "Same!"
    fi

你可能感兴趣的:(Perl,shell, Js比较文件)