Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with escaping strings #31

Closed
ucarion opened this issue Aug 21, 2013 · 1 comment
Closed

Issues with escaping strings #31

ucarion opened this issue Aug 21, 2013 · 1 comment

Comments

@ucarion
Copy link
Contributor

ucarion commented Aug 21, 2013

Hi,

I ran into a bit of an issue today when I was executing something like this:

image = Docker::Image.all.first
puts image.run("echo 'foo bar'").attach

The outputted result is 'foo bar' instead of the expected foo bar. I think what's causing this is the line: https://github.com/swipely/docker-api/blob/master/lib/docker/image.rb#L20.

Is there a reason for this behavior? If so, how could I avoid this issue? I do want to be able to use quotes and other bash goodies.

@ucarion
Copy link
Contributor Author

ucarion commented Aug 21, 2013

Never mind; I found a (relatively wacky) way to circumvent this issue:

puts image.run("/bin/bash", "-c", "echo 'foo bar'").attach

Sorry for the false alarm.

@ucarion ucarion closed this as completed Aug 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant