手机
当前位置:查字典教程网 >脚本专栏 >linuxshell >shell对比文件内容脚本分享
shell对比文件内容脚本分享
摘要:复制代码代码如下:#!/bin/shfunction_diffab(){x=0foriin`cat$1`;doforjin`cat$2`;d...

复制代码 代码如下:

#!/bin/sh

function _diffab(){

x=0

for i in `cat $1`;do

for j in `cat $2`;do

if [ $i == $j ];then

x=1

break;

fi

done

if [ $x -ne 1 ];then

echo $i

fi

x=0

done

}

if [ "$1" == "" ] || [ "$2" == "" ];then

echo "use like this: $0 filea fileb"

else

{

_diffab $1 $2

_diffab $2 $1

}

fi

【shell对比文件内容脚本分享】相关文章:

linux安装php扩展脚本分享

ftp自动上传脚本分享

linux中批量修改文件名的脚本代码

shell监控脚本 准备工作分享

shell中冒号的特殊用法分享

Shell脚本实现的阳历转农历代码分享

判断文件是否存在的shell脚本代码

linux自动清理日志脚本分享

备份shell脚本实例代码

shell脚本学习与总结

精品推荐
分类导航