bug-coreutils
[Top][All Lists]
Advanced

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

dircolors and default shell


From: Eric Blake
Subject: dircolors and default shell
Date: Thu, 08 Sep 2005 07:06:29 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Right now, if SHELL is not exported, and dircolors was not given a shell
option, it refuses to output anything:
dircolors: no SHELL environment variable, and no shell type option given

Would it make more sense if dircolors tried to do a bit more sleuthing
before giving up, such as trying getpwuid(getuid())->pw_shell, or
examining files in /proc to reverse-engineer if the parent process of
dircolors is a shell on systems that support procfs?  Or is this too
likely to be fraught with portability problems and potential wrong choices?

One reason I ask is that by default, bash ensures that SHELL exists
(either inherited from the environment, or populated as a shell variable),
but does not put SHELL into the environment when populating the shell
variable.  So it can be rather confusing that 'echo $SHELL' prints
something (the shell variable), but dircolors fails without -b because
SHELL was not exported to the environment.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDIDdV84KuGfSFAYARAsSsAJwJrzNLQ1XS02VFf0EcgH/nbd46UwCePMx4
VMg67tllleK+gBE0nzIJ1Tc=
=/X7h
-----END PGP SIGNATURE-----




reply via email to

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