# grep "请求报文:" application-20170822-*.log >> applog

# cat applog|cut -d ":" -f2 >> mylog

# cat mylog | while read line ; do mysql -h192.168.55.254 -uceshi -pCeshi123 -e "use mydb;insert into pengcheng (log) values ('$line');" ; done

发现当一行的内容过多时,使用  for aa in `cat mylog` ; do ...时,不能读取整行的内容,但是使用 while read line 语句可以实现。

另外,当在linux系统中使用mysql客户端命令时,也要记得修改mysql客户端的字符编码,即 my.cnf 文件添加:

[client]
default-character-set = utf8

while read line的更多相关文章

  1. ILJMALL project过程中遇到Fragment嵌套问题:IllegalArgumentException: Binary XML file line #23: Duplicate id

    出现场景:当点击"分类"再返回"首页"时,发生error退出   BUG描述:Caused by: java.lang.IllegalArgumentExcep ...

  2. Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.

    启动tomcat, 出现, ( 之前都是好好的... ) [lk ] ERROR [08-12 15:10:02] [main] org.springframework.web.context.Con ...

  3. 关于xml加载提示: Error on line 1 of document : 前言中不允许有内容

    我是在java中做的相关测试, 首先粘贴下报错: 读取xml配置文件:xmls\property.xml org.dom4j.DocumentException: Error on line 1 of ...

  4. Eclipse "Unable to install breakpoint due to missing line number attributes..."

    Eclipse 无法找到 该 断点,原因是编译时,字节码改变了,导致eclipse无法读取对应的行了 1.ANT编译的class Eclipse不认,因为eclipse也会编译class.怎么让它们统 ...

  5. Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"

    同事反馈他在一测试服务器(CentOS Linux release 7.2.1511)上修改了/etc/profile文件后,使用source命令不能生效,让我帮忙看看,结果使用SecureCRT一登 ...

  6. [LeetCode] Line Reflection 直线对称

    Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given ...

  7. [LeetCode] Tenth Line 第十行

    How would you print just the 10th line of a file? For example, assume that file.txt has the followin ...

  8. [LeetCode] Max Points on a Line 共线点个数

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  9. "Installation failed !" in GUI but not in CLI (/usr/bin/winusb: line 78: 18265 Terminated )

    "Installation failed !" in GUI but not in CLI (/usr/bin/winusb: line 78: 18265 Terminated ...

  10. How to build .apk file from command line(转)

    How to build .apk file from command line Created on Wednesday, 29 June 2011 14:32 If you don’t want ...

随机推荐

  1. RabbitMQ用户角色及权限控制(转)

    转载至:https://blog.csdn.net/awhip9/article/details/72123257 2017年05月15日 10:39:26 awhip9 阅读数:3538   ### ...

  2. c#特性学习(1)

    C#中的特性我认为可以理解为Java中的注解,见名知意,就是描述这个类或是属性的一个信息,是一个语法糖.原理运用的是反射,下面我来演示一下它的原理.其中引用了软谋的代码. 举一个栗子.我们在做code ...

  3. ELK 日志查询分析nginx日志

    # ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticse ...

  4. Kafka参数详解

    一.相关参数配置 System 系统参数 #唯一标识在集群中的ID,要求是正数. broker.id=0 #服务端口,默认9092 port=9092 #监听地址,不设为所有地址 host.name= ...

  5. webpack入门详解

    webpack入门详解(基于webpack 3.5.4  2017-8-22) webpack常用命令: webpack --display-error-details    //执行打包 webpa ...

  6. CentOS之Vim

    安装  yum install -y vim-enhanced 移动光标 h或者向左的方向键:光标向左移动一个字符 l或者向右的方向键:光标向右移动一个字符 j或者向下的方向键:光标向下移动一个字符 ...

  7. Spring MVC 处理异常

    SpringMVC处理异常: 1 使用@ExceptionHandler注解 只有ModelAndView可以携带错误信息 @ExceptionHandler public ModelAndView ...

  8. 常见的web安全及防护原理

    1.0 sql注入 sql注入原理:就是通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令. sql注入防护: 1.永远不要信任用户的输入,要 ...

  9. 图像生成-VAE简介

    VAE(Variational Autoencoder)   生成式模型 理论: 基于贝叶斯公式.KL散度的推导 1. 自动编码器的一般结构 2. 产生一幅新图像 输入的数据经过神经网络降维到一个编码 ...

  10. js数组冒泡

    var arr 1= [1, 2, 3, 4, 5]; 最简单的 每组数字之间用逗号隔开 第一个数的索引值为0.数字为1 以此类推 中括号的内容是存var arr2 = Array(1, 2, 3); ...