[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] printenv: add feature to print names only
From: |
Gianluca Mascolo |
Subject: |
Re: [PATCH] printenv: add feature to print names only |
Date: |
Tue, 13 Dec 2022 22:22:02 +0100 |
User-agent: |
Zoho Mail |
---- Il mar, 13 dic 2022 14:04:31 +0100, Pádraig Brady ha scritto ---
>
>
> This has some merit,
> given that's it's awkward to postprocess printenv output
> in the presence of multiline env values.
>
> Could you detail some use cases for this?
>
> thanks,
> Pádraig
>
I think that it may be useful in a couple of cases at least:
1) I work remotely and during online meetings I often need to share my screen.
Sometimes I need to check if a variable containing an authentication token is
exported locally before executing a command without showing it's content to
remote attendees. At the moment, I use an alias for that purpose:
alias lsenv='printenv | grep --color=never -oE "^[^=]+"'
2) It may be useful to print some information about the current environment of
CI/CD pipeline scripts for debugging purposes and be sure that nothing
sensitive will be displayed (although many CI/CD systems automatically mask
those kinds of values with asterisks).
Using printenv directly for these scopes is just a convenience, and it can be
done in other ways, but I think that embedding this small feature into printenv
would be nice.
Thanks
Gianluca