Hi all,
I have shell script that reads in a file, which is a string of text. That text makes up an SQL query later in the script.
How can I add slashes before each apostrophe so as not to make an SQL error?
EG:
This is what it could be....
Code:
MSG="This isn't my message, it's your msg"
This is what I want:
Code:
MSG="This isn\\'t my message, it\\'s your msg"
Just like the PHP function add_slashes()
Any idea anyone?
Thanks!