Stupid bash question
Les Mikesell
lesmikesell at gmail.com
Wed Dec 12 05:07:25 UTC 2007
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 at gmail.com
More information about the fedora-list
mailing list