Created
February 24, 2026 02:00
-
-
Save UnnaturalTwilight/05921ce7d3b427443e49e3e476d88606 to your computer and use it in GitHub Desktop.
Formated printing of environment variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # simlink this file into PATH with a name like 'echoenv' or smth | |
| printenv | | |
| sort | grep "^$1" --ignore-case | | |
| bat --no-paging --style=grid,numbers | |
| # replace above line with cat to make more portable | |
| # print PATH | |
| if [[ -z "$1" || "$1" = "PATH" || "$1" = "path" ]]; then | |
| echo " │ PATH:" | |
| printenv PATH | sed "s/:/\n/g" | | |
| bat --no-paging --style=grid,numbers | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment