I have following in bash script:
sqlite3 database.db "INSERT INTO tbl (col1,col2) VALUES ('\"$line\"','\"$stdout\"');"
,where $line
variable isn't going to make any trouble, but my $stdout
variable is output from whois $line
, so it contains many chars, one of them
being '
which breaks the sqlite3
syntax.
Is there some way I could quote-escape that variable, so that it passes well in this query?
EDIT
Sorry, I found my solution here, https://stackoverflow.com/a/14340973/2434479.
Should I delete this question?