today work Roll

#1.get seeven_test

--------------------------
grep ^attributeTypes= ctbkUat3.schema | grep "X-ORIGIN 'user defined'" >>ctbkUat3.schema.udf
grep ^attributeTypes= ctbkUat3.schema | grep "X-ORIGIN ( ' ' 'user defined' )" >>ctbkUat3.schema.udf
grep ^objectClasses= ctbkUat3.schema | grep "X-ORIGIN 'user defined'" >>ctbkUat3.schema.udf
##下面这句可能找出正确的
grep ^objectClasses= ctbkUat3.schema | grep "X-ORIGIN ( ' ' 'user defined' )" >>ctbkUat3.schema.udf

cat ctbkUat3.schema.udf|sed 's/^attributeTypes=/attributetype /'|sed 's/^objectClasses=/objectclass /'|sed -r "/'email'|'top'/s/^/#/" >seeven_test

 

#2.Roll way and mind

 

对文件4操作
截取数据:以"s=( "开头,以" NAME"结束


按分隔符截取:echo hello, world | cut -f 2 -d " "则输出"world"(截取以空格分割的第二部分)


cat ctbkUat3.schema.udf|sed 's/^attributeTypes=/attributetype /'|sed 's/^objectClasses=/objectclass /'|sed -r "/'email'|'top'/s/^/#/" >seeven_test

grep -E "USAGE directoryOperation|NO-USER-MODIFICATION" $2 | cut -f4 --delimiter=' '|tr -d "'"|sed 's/^/^/' >sun_reserved_attr

grep -E "USAGE directoryOperation|NO-USER-MODIFICATION" ctbkUat3.schema | cut -f4 --delimiter=' '|tr -d "'"|sed 's/^/^/'


cat $1|{
while read aLine; do
    ########不论大小写将sun_reserved_attr非空的部分
        echo $aLine|grep -i -f sun_reserved_attr >/dev/null 2>&1
        isFound=`echo $?`
        if test $isFound -eq 0; then
                echo "#$aLine" >>$3
        else
                echo $aLine >>$3
        fi
done
}

 
--要替换的部分
grep -E " /(|NAME " seeven_test| cut -f3 --delimiter=' '

 

#调用函数
#randomlist 20

#第二部分 处理问题文件

cat seeven_test|{
while read eachLine; do
 #判断指定部分是否数字和"."的组和
 if grep -E " /(|NAME " $eachLine| cut -f3 --delimiter=' '#未完成
  printf ""
 else
  randomlist 20
  grep -E " /(|NAME " $eachLine| cut -f3 --delimiter=' '|sed -e 's/^*/'
 fi
done


}

----------------------

3.the way from Danny

the command that can help test the correctness of oid: grep -E ^/([0-9]+[/.]+/)+[0-9]+$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值