How to use command parameters that have embedded quotes?
See original GitHub issueFor example:
command = '/usr/bin/xvfb-run -a -s "-screen 0 1600x1200x24" ...'
c.create_container(image=settings.MYIMAGE, stdin_open=True, tty=True, command=command)
The resulting command always strips out the double quotes, resulting in failures. I’ve tried everything I can think of to escape, but the result is always:
/usr/bin/xvfb-run -a -s -screen 0 1600x1200x24 ...
Which isn’t really what I need.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Embedding Double Quotes in the Command - ITPro Today
The command-line parser uses the double quote (") character as an argument delimiter; that is, an argument can contain spaces if it's enclosed...
Read more >Quotes, Escape Characters, Delimiters - Windows CMD - SS64
How-to: Escape Characters, Delimiters and Quotes at the Windows command line. Delimiters. Delimiters separate one parameter from the next - they split the ......
Read more >windows - Escape double quotes in parameter - Stack Overflow
A double-quoted group ignores spaces as value separators when passing parameters to programs: program one two "three and more" will pass three parameters...
Read more >Passing command line args with quotes - TechNet - Microsoft
Define your script parameters using a param block a the top of the script. Then you can use your parameters from the command...
Read more >Shell Command Line Quoting Mechanisms - Ian! D. Allen
Note that quotes and backslashes are themselves meta-characters to the shell, so if you want quotes and backslashes to appear in command line...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haven’t tried. Sorry, I found a solution and ran with it.
FWIW when you use a list for the command, you don’t need quotes at all. Each element of the list is exactly one command line argument, even if it contains spaces.
HTH