Skip to main content

Parse line as shell words.

Project description

Build Coverage PyPI version

Parse line as shell words.

Usage

>>> from shellwords import ShellWords
>>> s = ShellWords()
>>> s.parse("./foo --bar=baz")
[u'./foo', u'--bar=baz']
>>> s.parse('./foo --bar=baz foobar')
[u'./foo', u'--bar=baz', u'foobar']
>>> os.environ['FOO'] = 'bar'
>>> s = ShellWords(parse_env=True)
>>> s.parse("./foo $FOO")
[u'./foo', u'bar']
>>> s = ShellWords(parse_backtick=True)
>>> s.parse("./foo `echo $SHELL`")
[u'./foo', u'/bin/bash']

Thanks

This is based on go-shellwords package.

Changelog

0.1.0 (2015-01-29)

  • Initial Release

Project details


Release history Release notifications

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
shellwords-0.1.0-py2.py3-none-any.whl (4.3 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jan 29, 2015
shellwords-0.1.0.tar.gz (3.7 kB) Copy SHA256 hash SHA256 Source None Jan 29, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page