Answer the question
In order to leave comments, you need to log in
How to INSERT into a table with special characters through a bash script?
Hello, I have a problem, I need to INSERT into a MySQL table through a bash script, but I need to INSERT into a table with special characters, all my attempts ended in failure, I searched on stackoverflow, I tried to use it `
for a table and columns, I will be grateful for your help in my problem, this is how i tried to use INSERT in my script:
INSERT INTO `ener-data`(`id`, `date`, `v-out-sun`, `a-out-sun`, `v-out-h`, `a-out-h`, `in1`, `in2`, `in3`, `in4`, `in5`) VALUES (null,'$date', и.т.д)
Answer the question
In order to leave comments, you need to log in
In single quotes, characters can be passed as is.
In double quotes, some retain the special meaning ($, \)
backslash escapes the next one character if it is a special character.
You did not give an example of a line that does not work for you, but in fact it is not difficult there.
You can put it in a separate file, you can do redirection through <
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question