Write and test your shell scripts using Python
Shell scripts are great - they run on most *nix machines, they allow you interact with the file system easily, and they are light weight and don't require a massive runtime. However, the syntax is error prone and they are difficult to manage and test. Shellshock lets you write and test your shell scripts using the Python syntax and test cases you already know and love.
Installation
Writing with Shellshock requires Python. The shell scripts it outputs do not require Python to run though.
pip install shellshock
Usage
To convert a Python shellshock script to a regular shell script:
shellshock my_script.py -o my_script.sh
Starting with an existing shell script
Let's say you have an existing shell script you want to convert that looks like this:
oldscript.sh
if [ -f "file" ]; then
echo "ok"
fi
You can easily make this a shellshock script using the ss.shell method and a multiline string at the top of the file:
oldscript.py
import shellshock as ss
ss.shell("""
if [ -f "file" ]; then
echo "ok"
fi
""")
Then you could convert it to full Python shellscript syntax like so:
newscript.py
import shellshock as ss
if ss.isfile("file"):
print("ok")
Metadata
Release files for shellshock 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shellshock-0.0.1.tar.gz | 11.4 kB | Without provenance | Details for shellshock-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shellshock-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for shellshock-0.0.1-py3-none-any.whl |
Total release size: 52.9 kB
Release files / shellshock-0.0.1.tar.gz
| Download URL | shellshock-0.0.1.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6eaea358bddc45b697213bf076a722af99aafe8a4233d041f856333e45fe55a4
|
|
BLAKE2b-256 checksum How to use checksums |
46cd510a30af9ece158c658c40ec25c020457dcda124171fb2788c15b09e1c30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3
|
Release files / shellshock-0.0.1-py3-none-any.whl
| Download URL | shellshock-0.0.1-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
076961280910937f34ac49077be8018c58af6664e97ba643ccc9e8add9526296
|
|
BLAKE2b-256 checksum How to use checksums |
d5cc873d3b446426c419eba7285d48bd43538882e41b45e04b7435469b189ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3
|
Security for shellshock 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.