coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suggestion: $LS_ARGS


From: Eric Blake
Subject: Re: suggestion: $LS_ARGS
Date: Fri, 23 Feb 2018 08:01:23 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

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

[Prev in Thread] Current Thread [Next in Thread]