Top-rated recipes tagged "quote"http://code.activestate.com/recipes/tags/quote/top/2010-12-03T09:16:45-08:00ActiveState Code RecipesBetter quote module for bash shells (Python)
2010-12-03T09:16:45-08:00Kevin L. Sitzehttp://code.activestate.com/recipes/users/4173535/http://code.activestate.com/recipes/577483-better-quote-module-for-bash-shells/
<p style="color: grey">
Python
recipe 577483
by <a href="/recipes/users/4173535/">Kevin L. Sitze</a>
(<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/escape/">escape</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/quote/">quote</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/shell/">shell</a>).
</p>
<p>This Python module quotes a Python string so that it will be treated as a single argument to commands ran via os.system() (assuming bash is the underlying shell). In other words, this module makes arbitrary strings "command line safe" (for bash command lines anyway, YMMV if you're using Windows or one of the (less fine) posix shells).</p>