In general, I would like to know if there are any discrepancies between the MacPorts coreutils and the GNU coreutils, and how I might go about answering this question myself. In particular, I don't understand why the
su command (or the
gsu command, since all of the MacPorts coreutils applications also seem to come prefixed with a 'g') doesn't seem to be included by MacPorts.
First, I check that I have the coreutils package installed:
$ port installed coreutils The following ports are currently installed: coreutils @8.22_0 (active) $ port info coreutils coreutils @8.22 (sysutils) Variants: universal Description: The GNU Core Utilities are the basic file, shell, and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every operating system. Previously these utilities were offered as three individual sets of GNU utilities, fileutils, shellutils, and textutils. Those three have been combined into a single set of utilities called the coreutils. Homepage: http://www.gnu.org/software/coreutils/ [...]
So far so good. Then I look for instances of
gsu on my path:
$ which -a su gsu; /usr/bin/su
Nothing; the GNU
su isn't there. As a sanity check, I look for some other coreutils applications, e.g.
which -a rm grm /opt/local/libexec/gnubin/rm /bin/rm /opt/local/bin/grm
It looks like the directories to check are
/opt/local/libexec/gnubin, so I look there:
$ ls -1 /opt/local/bin /opt/local/libexec/gnubin | grep -x 'su\|gsu'
Again, nothing. Now, this is almost certainly redundant, but I also try looking with the
port contents command:
$ port contents coreutils | grep -x ".*su"
Nothing. Am I certain that
su is included in GNU coreutils? No, I guess not. So I check here:
It looks like it is; it's listed under the Shell Utililites header. So what gives?