Re: Stupid bash question

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

 



Joe Smith wrote:
Tony Nelson wrote:
 > The reason seems weak to me, but test does not require a closing
 > square bracket, while [ does, and:
 > ...
 >> GNU Coding Standards now declare that the behaviour of binary
 >> should not depend on its name.

 From http://www.gnu.org/prep/standards/html_node/User-Interfaces.html:
Please don't make the behavior of a utility depend on the name used to
invoke it. It is useful sometimes to make a link to a utility with a
different name, and that should not change what it does.

Sounds more like a request than a declaration ;-)

I wish they had provided some rationale, seeing as how the practice has a long history on Unix, and I (at least) have not run into any situation where it caused a problem.

And there are good reasons for it. /bin/[ vs. /bin/test are probably extremely rarely used since the shell built-in takes precedence unless you specify the path explictly, but cp/ln/mv traditionally were hard links, saving not only disk space but loading time and RAM when they are mapped from the same inode.

--
  Les Mikesell
   lesmikesell@xxxxxxxxx


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux