[X-Unix] A little shell scripting help

Philip J Robar pjrobar at areyoureallythatstupid.org
Tue Oct 4 02:35:33 PDT 2005


On Oct 3, 2005, at 6:57 PM, Doug McNutt wrote:

> At 14:46 -0700 10/3/05, Philip J Robar wrote:
>> The '[' is the test command, which tests your expression. The  
>> result  of the test is then evaluated by the if. Note that the  
>> spaces after  the '[' and before the ']' are required.
>
> And that's the reason I use tcsh.  If you look at /bin you'll find  
> an executable file named "[". It is actually a link to the UNIX  
> tool "test" The space is the normal thing required between a  
> command and its arguments.

'[' has been a built-in in all modern shells that use it for years.  
The '[' in /bin is just there for compatibility.

You should read <http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/>  
if you haven't already.


Phil
--
"I distrust those people who know so well what God wants them to do  
because I notice it always coincides with their own desires." --  
Susan B. Anthony





More information about the X-Unix mailing list