How to escape single quote using awk in a bash script

后端 未结 4 804
不思量自难忘°
不思量自难忘° 2021-01-24 02:16

This is what I have so far, tried multiple ways but can\'t get it just right. My goal is to sanitize the input to prevent problems while inputting to mysql from text file

<
4条回答
  •  清酒与你
    2021-01-24 02:54

    What you want is:

    awk '{gsub(/\047/,".")}1' file
    

    See http://awk.freeshell.org/PrintASingleQuote.

提交回复
热议问题