News for hackers. Stuff that matters.
Re:Don’t use environment variables for configuration by aarbor989 on Thursday April 01, 2021 @02:40AM (#26657285)
Maybe I live under a rock, but I feel like command line utilities taking environment variable arguments just isn’t that common of a practice? The only examples I can think of are when an argument is more of a “global variable” that many different commands may find useful such as JAVA_HOME, GITHUB_TOKEN, etc. For web applications and docker containers, environment variables fit easily into the deployment process and for all intents and purposes, are pretty much static.
Re:Don’t use environment variables for configuration by coldtea on Thursday April 01, 2021 @02:46AM (#26657320)
>Maybe I live under a rock, but I feel like command line utilities taking environment variable arguments just isn’t that common of a practice?

Nope, it's quite common. Many standard UNIX cli utilities take some environment variables (including things like LOCALE). Also common in scripts, setting up programming languages paths, etc.

It's also not a bad practice, contrary to what the author says.

Re:Don’t use environment variables for configuration by saurik on Thursday April 01, 2021 @03:20AM (#26657513)
LS_COLORS and GREP_COLORS are weirdly-specific... but arguably aren't!
Re:Don’t use environment variables for configuration by mfontani on Thursday April 01, 2021 @02:53AM (#26657359)
Examples I've used in the past few days, from memory - along the lines of:

LC_ALL=C foo

PAGER=cat man ls

TZ=UTC date

Re:Don’t use environment variables for configuration by aarbor989 on Thursday April 01, 2021 @02:58AM (#26657377)
These are good examples but I think these fit under my “global argument” umbrella. Imagine if every Linux command had a different argument name for the pager?