Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Toe

macrumors 65816
Original poster
Mar 25, 2002
1,101
2
Sorry if this is a unix noob question, but... no that's not a typo.

In your Terminal, do:
ls -la /bin

That will show you a directory of everything in your root bin directory (bin is for "binaries," roughly the unix word for applications). In there, the first file (on two of my Tiger computers, anyway) is called: [

What the heck is that?

TIA
 
[ is an alias of the test command.

It lets you use shorter syntax in a shell script.

Type "man test" for all of the gory details about that command.

Example: Normal syntax:
Code:
if test -f $1
then
    echo File $1 exists.
else
    echo File $1 does not exist.
    fi
Shortcut syntax, using [ and also using ; instead of a linebreak:
Code:
if [ -f $1 ] ; then
    echo File $1 exists.
else
    echo File $1 does not exist.
    fi
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.