A simple tool to analyze how a shell script modifies environment variables
Project description
delta-env
This is a very simple tool to report environment variable changes when a shell script is sourced. Useful while creating modulefiles for various applications that are shipped with scripts that set up the user environment.
This package does not depend on any additional python packages, only requirement is python > 3.0.0
. Does not work on Windows operating system.
What the tool does is simply sourcing the given script and reporting differences from the default environment variables in an organized way.
WARNING This tool WILL carry out the actions in the given script to be analyzed. If it is of harmful nature, damage will be done. Do NOT run this tool as
root
. Do NOT run this tool with scripts that are of unknown/unstrusted sources!
Installation
Clone this repository, cd
into the cloned directory, and install via pip
,
pip install .
Usage
This tool is meant to be used from the command line via the executable delta-env
,
delta-env <path-to-script>
The output will be displayed in the terminal screen, reporting added, removed and modified environment variables seperately.
By default, modifications are reported with respect to the default user environment that is present after creation of a login shell. This behaviour can be changed by using the --from-current
argument to use the current environment (where delta-env
is executed) as basis. Note that environment variables that were created without the export
command will not be passed to subprocesses, and hence will not be visible to delta-env
.
If no shell executable is supplied via --shell <path-to-shell>
argument, it is obtained from the value of environment variable SHELL
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for delta_env-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15a2d3e6de534ef62afa75f48941cfb054b043085c70f1af8b43df26051b84af |
|
MD5 | 42420558364c9d03f6d9b8541110659b |
|
BLAKE2b-256 | 0457d5d200db042956e7714233b4f4304210f431c6de2b59c7268d0f9aebc0db |