Sunday 2 June 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...