shell command needs whitespace characters escaped
metaperl
metaperl at gmail.com
Fri Dec 8 11:42:34 EST 2006
More information about the Python-list mailing list
Fri Dec 8 11:42:34 EST 2006
- Previous message (by thread): shell command needs whitespace characters escaped
- Next message (by thread): shell command needs whitespace characters escaped
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I downloaded a file which has a space in the filename. I want to run a
shell unzip on it, but it fails in my current code:
syscmd = "cd %s ; unzip %s" % (self.storage.input,
file.basename())
os.system(syscmd)
because no escaping was done.
Is there a more principled way to construct a shell command and execute
it so that all necessary characters are escaped?
- Previous message (by thread): shell command needs whitespace characters escaped
- Next message (by thread): shell command needs whitespace characters escaped
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list