Skip to main content

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


Download files

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

Source Distribution

delta-env-1.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

delta_env-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file delta-env-1.0.0.tar.gz.

File metadata

  • Download URL: delta-env-1.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for delta-env-1.0.0.tar.gz
Algorithm Hash digest
SHA256 96fb9a2b8a3b964cd72a7de6f62a8ad9316d0280b9ad86029361b37f5786db66
MD5 ec3c3588a65c53801f49fe13ee2c6696
BLAKE2b-256 bd8e955f3d060fc06badd041de87ba1277e9341f34a221a99413ca5a2b8d2a8a

See more details on using hashes here.

File details

Details for the file delta_env-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: delta_env-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for delta_env-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15a2d3e6de534ef62afa75f48941cfb054b043085c70f1af8b43df26051b84af
MD5 42420558364c9d03f6d9b8541110659b
BLAKE2b-256 0457d5d200db042956e7714233b4f4304210f431c6de2b59c7268d0f9aebc0db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page