Python Forum

Full Version: is this string shell quote safe?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i need to find or write a function that can tell me if a given string is safe or needs to be quoted when being used to pass as an argument for a command being executed through a shell like /bin/sh on a Posix system. maybe it could return the string to use, quoted (and escaped as needed), or not, as needed.
i was supposed to do the work of finding it.