5 ms·
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
by aarbor989 5y ago
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.
- coldtea 5y ago>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.
- mfontani 5y agoExamples 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
- aarbor989 5y agoThese 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?
- saurik 5y agoLS_COLORS and GREP_COLORS are weirdly-specific... but arguably aren't!