LFS 5.0, coreutils install : "/bin/[" ?

eklirmr at wanadoo.fr eklirmr at wanadoo.fr
Sat Feb 21 04:00:57 PST 2004


On Fri Feb 20 2004 at 07:24:24 (-0600), Cynthia Higginbotham wrote:
> On Friday 20 February 2004 06:58 am, you wrote:
> > In chapter 6 of the LFS 5.0 manual, at the end of the section
> > dealing with the installation of coreutils, it is requested to make a
> > link by typing "ln -s test /bin/[". I know about the common syntax of "ln"
> > and have read the LFS FAQ concerning it, but still, writing "/bin/["
> > puzzles me, even more as the bash shell doesn't complain at all. Thus my
> > question: what is actually this command doing, since the "test" executable
> > was already copied previously to the /bin directory ?
> 
> It's aliasing "test" to "[", which is used in shell scripts all the time.
> 
>        eg. if [ -x somefile ] ...
> 
>                      --Cynthia


Ah, that explains something that's been worrying me ever since I
started looking at some of the shell scripts (eg startx).  But what
happens to the "]"?  Now that it's not paired with the "[", shouldn't
that generate an error?

Paul

-- 
http://perso.wanadoo.fr/paul.bailey/
--



More information about the lfs-support mailing list