sqlite
データベースに値を挿入するbashスクリプトを作成しました。コマンドは次のとおりです
sqlite3 ${db_name} "insert into ${table_name} (${column1},${column2}) values ('$f1','$f2');"
このコマンドf1
は、変数に一重引用符が含まれるまで正常に機能します
# e.g f1="I'm just kidding"
# the command reported error
Error: near "m": syntax error
誰かが変数内の一重引用符をエスケープする方法を教えてもらえますか?任意の推奨事項をいただければ幸いです。ありがとう!