On 02/23/2018 02:14 AM, Harald Dunkel wrote:
Hi folks,

I would like to suggest to introduce an environment variable
"LS_ARGS", holding the default arguments to ls (similar to $LESS).

This could help to simplify the user environment. You don't have
to create clumsy aliases for ls anymore, but you could set

     export LS_ARGS="--color=never --quoting-style=escape"

in your .bashrc without affecting foreign ls implementations (AIX,
OpenBSD, Solaris, etc).

Sorry, but we are discouraging the use of magic environment variables that change default behavior (especially introducing new ones), precisely because they can be a surprise source of breakage to unsuspecting scripts. Or, if you make the variable magic so that it is only consulted when invoked from an interactive user, so that you ensure you don't break scripts with an unsuspected change to the defaults, then you have to consider how easy it is to discover what your current interactive setup is doing. But an interactive-only env-var has no more effect than an interactive alias or function wrapper, yet 'type ls' will show you what alias or functions you have set but not what env-vars you have set. Thus, even though it has the same effect on changing the interactive default, it is action at a distance that is not as easily discoverable to change that default if it is not desired. So we are unlikely to act on this proposal.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to