Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Env Var Explorer

Search for where an environment variable is defined across:

  • System-wide shell init (/etc/bashrc, /etc/profile, etc.)
  • User shell init files (~/.bashrc, ~/.bash_profile, etc.)
  • PAM environment (/etc/security/)
  • systemd unit files (Environment= and EnvironmentFile= directives, with recursive scanning of referenced files)
  • Sysconfig / app dirs (/etc/sysconfig/, /etc/default/, /etc/conf.d/)
  • Live processes (/proc/*/environ, own user only without root)
  • Running Docker containers (via docker inspect)

ℹ️ Script is mostly generated by LLM with some manual tweaks

Example

$ ./env_var_explorer.sh AIRFLOW_HOME

=== System-wide shell init ===
  ✔ /etc/environment
    1:AIRFLOW_HOME=/home/airflow/airflow

=== User shell init files ===

=== PAM environment ===

=== systemd unit files ===
  ✔ /etc/systemd/system/airflow-webserver.service
    10:Environment="AIRFLOW_HOME=/home/airflow/airflow"
  ✔ /etc/systemd/system/airflow-flower.service
    10:Environment="AIRFLOW_HOME=/home/airflow/airflow"
  ✔ /etc/systemd/system/airflow-scheduler.service
    10:Environment="AIRFLOW_HOME=/home/airflow/airflow"
  (skipped — not readable: /etc/sysconfig/sshd)
  (skipped — not readable: /etc/sysconfig/crond)
  (skipped — not readable: /etc/sysconfig/sshd)

=== Application / sysconfig files ===

=== Live processes with AIRFLOW_HOME in their environment ===
  ✔ PID 17831 (python3)  ←  PPID 1 (systemd)this
    AIRFLOW_HOME=/home/airflow/airflow
  ✔ PID 17831 (bash)  ←  PPID 17829 (sshd)this
    AIRFLOW_HOME=/home/airflow/airflow

=== Running Docker containers ===
  (docker not found in PATH, skipping)

────────────────────────────────────
Found! See matches above.
Some locations were skipped (not readable as current user).
Re-run with sudo for full coverage.

About

Search for where an environment variable is defined

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages