Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
what is /bin/[ ?? [closed]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
dryadcito
Apprentice
Apprentice


Joined: 08 Oct 2004
Posts: 170
Location: Spain

PostPosted: Fri Apr 15, 2005 6:07 am    Post subject: what is /bin/[ ?? [closed] Reply with quote

I've recently noticed this file, and I think it's name seems really strange... I'm wondering if I've got hacked. It has a creation date in the past, before my gentoo installation:

-rwxr-xr-x 1 root root 22988 oct 27 21:39 /bin/[

Google doesn't search the "/bin/[" but just the "bin" string, so I'm not able to find anything about this, and of course it has no man page.


Last edited by dryadcito on Fri Apr 15, 2005 6:50 am; edited 1 time in total
Back to top
View user's profile Send private message
Given M. Sur
l33t
l33t


Joined: 03 Feb 2004
Posts: 648
Location: No such file or directory

PostPosted: Fri Apr 15, 2005 6:16 am    Post subject: Reply with quote

It is shorthand for test.

So you can do things like
Code:
if [ "$1" = foo ]; then
    do_something
fi


instead of
Code:
if test "$1" = foo; then
  do_something
fi


It's quicker to type, and more readable when using [
Back to top
View user's profile Send private message
dryadcito
Apprentice
Apprentice


Joined: 08 Oct 2004
Posts: 170
Location: Spain

PostPosted: Fri Apr 15, 2005 6:50 am    Post subject: thank youuuuu Reply with quote

I knew about that syntax but I thought it was something built into the shell, not as a separate executable and .. well, I'm a n00b :S .


thanks, now I can sleep again :oops:
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Fri Apr 15, 2005 6:52 am    Post subject: Reply with quote

Moved from Networking & Security, please see this topic:

https://forums.gentoo.org/viewtopic.php?t=137883
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum