Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr/bin/[ - was ist das?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Fri Feb 10, 2006 1:56 pm    Post subject: /usr/bin/[ - was ist das? Reply with quote

Ich habe gerade durch Zufall einen binären Befehl namens [ in meinem Verzeichnis /usr/bin entdeckt... es scheint keine manpage dazu zu geben und google hat [ als Suchbegriff auch nicht lieb. Was ist das?

Robin
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5207

PostPosted: Fri Feb 10, 2006 2:02 pm    Post subject: Reply with quote

es wird in shell-scripts in verwendung mit if-anweisungen verwendet, und ist nichts anderes als eine kopie/symlink des programm test.
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
Romses
Apprentice
Apprentice


Joined: 20 Jan 2004
Posts: 257
Location: Frankfurt

PostPosted: Fri Feb 10, 2006 2:05 pm    Post subject: Reply with quote

Hallo

Dieses Programm brauchst du immer dann, wenn du in Scripten ein Konstrukt wie

Code:
if [ "a" == "b" ];


Es wird also für Vergleiche etc gebraucht (Daher auch immer das Leerzeichen hinter [ :) )

Gruß Romses
Back to top
View user's profile Send private message
Deever
Veteran
Veteran


Joined: 06 Jul 2002
Posts: 1354
Location: Zürich / Switzerland

PostPosted: Fri Feb 10, 2006 3:08 pm    Post subject: Reply with quote

Um eure Aussagen noch etwas zu präzisiern: Mindestens die Bash und die zsh benutzen dieses Binary nicht, sondern implementieren die obige If-Syntax als Bestandteil ihrer Sprache.

Gruß,
/dev
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Sat Feb 11, 2006 7:13 pm    Post subject: Reply with quote

Vielen Dank!

Robin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum 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