Converter Reference¶
Shellshock comes with many useful converter functions built-in. Here is the reference of these functions.
Examples are provided for most functions. For examples assume script.py is the input Shellshock script and script.sh is the output after Shellshock transpilation.
-
ss.
shell
(raw_shell_cmd)¶ Run a raw shell command. The argument will be output in its entirety.
Use this method when you want to write regular shell commands in your script.
Example: Basic Usage
import shellshock as ss ss.shell("chown 755 myfile")
#!/bin/sh chown 755 myfile
Example: Convert Existing ScriptWrap an entire existing shell script (or a part of a script) in ss.shell to partially migrate an existing script to Shellshockimport shellshock as ss ss.shell(""" chown 755 myfile # other existing shell script echo "output" """)
#!/bin/sh chown 755 myfile # other existing shell script echo "output"