一般来说,我想知道MacPorts coreutils和GNU coreutils之间是否存在任何差异,以及我如何自己回答这个问题。特别是,我不明白为什么su
命令(或gsu
命令,因为所有MacPorts coreutils应用程序似乎也带有'g'前缀)似乎不包含在MacPorts中。
首先,我检查我是否安装了coreutils包:
$ 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/
[...]
到现在为止还挺好。然后我找实例su
和gsu
我的路径:
$ which -a su gsu;
/usr/bin/su
没有; GNU su
不在那里。作为一个完整性检查,我寻找其他一些coreutils应用程序,例如rm
:
which -a rm grm
/opt/local/libexec/gnubin/rm
/bin/rm
/opt/local/bin/grm
它看起来像目录检查是/opt/local/bin
和/opt/local/libexec/gnubin
,所以我期待有:
$ ls -1 /opt/local/bin /opt/local/libexec/gnubin | grep -x 'su\|gsu'
再一次,没有。现在,这几乎肯定是多余的,但我也尝试用port contents
命令查找:
$ port contents coreutils | grep -x ".*su"
没有。我确定su
包含在GNU coreutils中吗?不,我猜不是。所以我在这里查看:
http://en.wikipedia.org/wiki/GNU_Core_Utilities#Programs_included_in_coreutils
它看起来像是; 它列在Shell Utililites标题下。什么给出了什么?