Cannot use sed inside it

10 views
Skip to first unread message

Alexandre MARRE

unread,
Mar 2, 2018, 10:48:35 AM3/2/18
to Ansible Project
Hello, I have a little bug with ansible parser I can't execute this code in ansible:

This code works on shell
echo "INSERT INTO scripts VALUES ('1', 'install-debian', '$(cat startupscripts/install-debian.sh | sed "s#'#''#g")', 0);" | docker exec -i --user postgres $(docker-compose ps -q postgres) psql baremetal

So I escaped it like this
"echo \"INSERT INTO scripts VALUES ('1', 'install-debian', '$(cat startupscripts/install-debian.sh | sed \"s#'#''#g\")', 0);\" | docker exec -i --user postgres $(docker-compose ps -q postgres) psql baremetal"


But this doesn't work can you tell me why ?
Reply all
Reply to author
Forward
0 new messages