You are not logged in.

#1 2010-09-08 16:06:24

myrlin
Member
Registered: 2010-06-11
Posts: 297

What is "usr/bin/["

I have just (successfully) installed Arch on my eeepc using kdemod3

I was browsing around, and discovered a file in my usr/bin directory called just "[".

Is this a legitimate file?

I'm a bit paranoid about security/rootkits/viruses etc, so I hope someone can put my mind at rest.

Thanks in advance

Offline

#2 2010-09-08 16:12:23

yejun
Member
Registered: 2009-10-21
Posts: 66

Re: What is "usr/bin/["

/usr/bin/[ is owned by coreutils 8.5-2

Offline

#3 2010-09-08 16:12:35

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: What is "usr/bin/["

[12:11:43] [~] : pacman -Qo /usr/bin/[
/usr/bin/[ is owned by coreutils 8.5-2

It is indeed legitimate smile

Offline

#4 2010-09-08 16:13:59

bananaoomarang
Member
Registered: 2009-10-29
Posts: 180

Re: What is "usr/bin/["

Sorry, it is definatly legit, just checked.

Last edited by bananaoomarang (2010-09-08 16:15:10)

Offline

#5 2010-09-08 16:40:15

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: What is "usr/bin/["

if [[ $x == 1 ]]; then

[[ is a bash built in which tests the condition before the ]] and provides an exit status for the if to evaluate

if [ $x == 1 ]; then

[ is a standalone binary (/usr/bin/[) which test the condition before the ] and provides an exit status for the if to evaluate

division of labor here is what lets one but anything within an if statement as long as it provides an exit code

Offline

#6 2010-09-08 16:48:39

myrlin
Member
Registered: 2010-06-11
Posts: 297

Re: What is "usr/bin/["

Phew!
Thanks everyone.
I'll be able to sleep tonight now!

Offline

#7 2010-09-08 18:19:27

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: What is "usr/bin/["

[thestinger ~]$ type [[
[[ is a shell keyword
[thestinger ~]$ type [
[ is a shell builtin

[ is actually built into bash too, along with echo, etc, but it emulates the standalone [

Offline

Board footer

Powered by FluxBB