Sunday, June 2, 2019

bash command unexpected EOF while looking for matching

I want to create a bash file where I connect to a docker container(mysql) and I run a query, and after I want to output the result in a csv file. What I've tried:



 #!/bin/bash

docker-compose exec db /bin/bash -c 'mysql -u user -ppassword dbname

-e "SELECT c.id, c.first_name, c.last_name,
c.email, cp.id, cp.name, company.id, company.name FROM
db.candidate c LEFT JOIN db.candidate_position cp ON
cp.id = c.candidate_position_id LEFT JOIN db.company company
ON company.id = c.company_id INTO OUTFILE \'Result.csv\'"'


The error is that I get:



 line 3: unexpected EOF while looking for matching `"'

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...