1. 创建一个名为xjh的文件,将如下内容写入到文本,并保存(注意:[test]开头至最后为一行,此处7行有内容一行为空,共8行)。
[test] 1 2016-06-22 15:36:21,342 INFO - # 修改支付明细开始 , insertPayReturn,orderItem={"createTime":1466580981215,"createUserId":"2112001000000001199","customerId":"2112001000000001199","discCostid":"3","ecardId":"2336666600500067176","factPayAmt":69.69,"id":"2111002500000007415","integralAmt":0,"integralQuan":0,"isDel":0,"payAccountNo":"xjh11111","payDate":1466580981384,"payDiscAmt":0.00,"payId":"2113002400000015588","paySerialNo":"0000003644253760","payStatus":"1","payTypeid":"2013100110000000","returnAmt":0,"sourceId":"1","sources":"1","updateTime":1466580981384,"updateUserId":"2112001000000001199","versionNum":1}
[test] 1 2016-06-22 04:36:21,342 ERROR - ##httpclient开始调用fft接口,进行销账操作,commonReqVo={"accountOrgCode":"888880002302900","billBarCodeNo":"220290413160610000069000","operateNoType":"0","orderCode":"CW2016060069201","payAmount":"69","payLifeType":"water","payMethod":"1","receiptDate":"20160622"}
[test] 1 2016-06-22 09:36:21,342 INFO - 销账完成,更新订单状态。。。vtu={"busiStatus":"1","chargeEndTime":1466580982110,"checkedStatus":"01","complainId":"1","confirmDate":1466580981272,"createTime":1466580916000,"createUserId":"2112001000000001199","cusName":"任光远","customerId":"2112001000000001199","disAmount":0,"id":"2113000200000000186","invoiceDate":1466580916879,"invoiceTitle":"1","isDel":0,"isOpenInvoice":"0","isShare":"0","orderAmt":69,"orderDate":1466580916879,"orderPayType":"1","orderStatus":"3","orderType":"07","payId":"2113002400000015588","payableAmt":69.69,"poundage":0.69,"recvGoName":"任光远","recvMobile":"1","updateTime":1466580982110,"updateUserId":"2112001000000001199","versionNum":1,"vtuCode":"CW2016060069201"}
[test] 1 2016-06-22 19:36:21,342 INFO - ## 销账完成,送优惠券开始...............payNo=0000003494602113
[test] 1 2016-06-22 20:36:21,342 DEBUG - ##httpclient开始调用fft接口,进行销账操作,commonReqVo={"accountOrgCode":"888880002302900","billBarCodeNo":"220290413160610000069000","operateNoType":"0","orderCode":"CW2016060069201","payAmount":"69","payLifeType":"water","payMethod":"1","receiptDate":"20160622"}
[test] 1 2016-06-22 22:36:21,342 INFO - 销账完成,更新订单状态。。。vtu={"busiStatus":"1","chargeEndTime":1466580982110,"checkedStatus":"01","complainId":"1","confirmDate":1466580981272,"createTime":1466580916000,"createUserId":"2112001000000001199","cusName":"任光远","customerId":"2112001000000001199","disAmount":0,"id":"2113000200000000186","invoiceDate":1466580916879,"invoiceTitle":"1","isDel":0,"isOpenInvoice":"0","isShare":"0","orderAmt":69,"orderDate":1466580916879,"orderPayType":"1","orderStatus":"3","orderType":"07","payId":"2113002400000015588","payableAmt":69.69,"poundage":0.69,"recvGoName":"任光远","recvMobile":"1","updateTime":1466580982110,"updateUserId":"2112001000000001199","versionNum":1,"vtuCode":"CW2016060069201"}
[test] 1 2016-06-22 23:36:21,342 CONSOLE - ## 销账完成,送优惠券开始...............payNo=0000003494602113
2. 输出xjh文本中含有"test" 字母 共有多少行的命令怎么写?
3. 删除xjh 文本中空行的命令怎么写?
4. 将xjh 文本中"2016" 修改为2017的命令怎么写?
5. 截取xjh 文本中 的日志级别,输出到屏幕的命令怎么写(日志级别:INFO,ERROR,DEBUG,CONSOLE)?
[test] 1 2016-06-22 15:36:21,342 INFO - # 修改支付明细开始 , insertPayReturn,orderItem={"createTime":1466580981215,"createUserId":"2112001000000001199","customerId":"2112001000000001199","discCostid":"3","ecardId":"2336666600500067176","factPayAmt":69.69,"id":"2111002500000007415","integralAmt":0,"integralQuan":0,"isDel":0,"payAccountNo":"xjh11111","payDate":1466580981384,"payDiscAmt":0.00,"payId":"2113002400000015588","paySerialNo":"0000003644253760","payStatus":"1","payTypeid":"2013100110000000","returnAmt":0,"sourceId":"1","sources":"1","updateTime":1466580981384,"updateUserId":"2112001000000001199","versionNum":1}
[test] 1 2016-06-22 04:36:21,342 ERROR - ##httpclient开始调用fft接口,进行销账操作,commonReqVo={"accountOrgCode":"888880002302900","billBarCodeNo":"220290413160610000069000","operateNoType":"0","orderCode":"CW2016060069201","payAmount":"69","payLifeType":"water","payMethod":"1","receiptDate":"20160622"}
[test] 1 2016-06-22 09:36:21,342 INFO - 销账完成,更新订单状态。。。vtu={"busiStatus":"1","chargeEndTime":1466580982110,"checkedStatus":"01","complainId":"1","confirmDate":1466580981272,"createTime":1466580916000,"createUserId":"2112001000000001199","cusName":"任光远","customerId":"2112001000000001199","disAmount":0,"id":"2113000200000000186","invoiceDate":1466580916879,"invoiceTitle":"1","isDel":0,"isOpenInvoice":"0","isShare":"0","orderAmt":69,"orderDate":1466580916879,"orderPayType":"1","orderStatus":"3","orderType":"07","payId":"2113002400000015588","payableAmt":69.69,"poundage":0.69,"recvGoName":"任光远","recvMobile":"1","updateTime":1466580982110,"updateUserId":"2112001000000001199","versionNum":1,"vtuCode":"CW2016060069201"}
[test] 1 2016-06-22 19:36:21,342 INFO - ## 销账完成,送优惠券开始...............payNo=0000003494602113
[test] 1 2016-06-22 20:36:21,342 DEBUG - ##httpclient开始调用fft接口,进行销账操作,commonReqVo={"accountOrgCode":"888880002302900","billBarCodeNo":"220290413160610000069000","operateNoType":"0","orderCode":"CW2016060069201","payAmount":"69","payLifeType":"water","payMethod":"1","receiptDate":"20160622"}
[test] 1 2016-06-22 22:36:21,342 INFO - 销账完成,更新订单状态。。。vtu={"busiStatus":"1","chargeEndTime":1466580982110,"checkedStatus":"01","complainId":"1","confirmDate":1466580981272,"createTime":1466580916000,"createUserId":"2112001000000001199","cusName":"任光远","customerId":"2112001000000001199","disAmount":0,"id":"2113000200000000186","invoiceDate":1466580916879,"invoiceTitle":"1","isDel":0,"isOpenInvoice":"0","isShare":"0","orderAmt":69,"orderDate":1466580916879,"orderPayType":"1","orderStatus":"3","orderType":"07","payId":"2113002400000015588","payableAmt":69.69,"poundage":0.69,"recvGoName":"任光远","recvMobile":"1","updateTime":1466580982110,"updateUserId":"2112001000000001199","versionNum":1,"vtuCode":"CW2016060069201"}
[test] 1 2016-06-22 23:36:21,342 CONSOLE - ## 销账完成,送优惠券开始...............payNo=0000003494602113
2. 输出xjh文本中含有"test" 字母 共有多少行的命令怎么写?
3. 删除xjh 文本中空行的命令怎么写?
4. 将xjh 文本中"2016" 修改为2017的命令怎么写?
5. 截取xjh 文本中 的日志级别,输出到屏幕的命令怎么写(日志级别:INFO,ERROR,DEBUG,CONSOLE)?
6. 将xjh 文本中的第二个字段求和?
1、echo '复制文本内容' > xjh.txt
查看是否写入: cat xjh.txt
2、grep -c test bylxjh.txt (显示7行)
4、sed -i 's/2016/2017/g' xjh.txt
-i是直接对文件生效