Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
was bedeutet 2>&1
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)
View previous topic :: View next topic  
Author Message
bernd
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 126
Location: Wilhelmshaven/Germany

PostPosted: Tue Aug 19, 2003 7:53 pm    Post subject: was bedeutet 2>&1 Reply with quote

Hallo,

nur eine kleine Frage. Ich habe jetzt schon öfters in Skripten folgendes gesehen ..... 2>&1. Also z.B. ...>/dev/null 2>&1. >/dev/null verstehe ich ja (stdout ins nirvana schicken) aber was bedeutet das 2>&1??

Vielen Dank!
Gruß,
Bernd
Back to top
View user's profile Send private message
Ragin
l33t
l33t


Joined: 14 Apr 2003
Posts: 776

PostPosted: Tue Aug 19, 2003 8:01 pm    Post subject: Reply with quote

Das bedeutet, dass du eine bestimmte Ausgabe auf eine andere "umleitest".

Hierbei bedeutet:
0 die Standardeingabe (durch Tastatur zum Beispiel)
1 die Standardausgabe (also normale Ausgabe wie zum Beispiel echo test)
2 die Standardfehlerausgabe (also alle Fehlermeldungen)

In den Shells sind diese 3 Kanäle von einander getrennt. Durch diese Trennung kannst du zum Beispiel sagen, dass nur Fehlermeldungen in eine Datei geschrieben werden (Befehl 2>/var/log/error.log) oder zum Beispiel Fehlerausgaben direkt mit in die Standardausgabe (Monitor) schreiben. Letzteres könntest du auch als verbose mode bezeichnen ;).

Wenn du alles auf /dev/null weiterleitest gibt es im Prinzip keine Ausgaben mehr, sondern es wird alles ins Nirvada geleitet.

http://www.linuxfibel.de/eaumleitung.htm
Back to top
View user's profile Send private message
Egal
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jan 2003
Posts: 99

PostPosted: Wed Aug 20, 2003 11:54 am    Post subject: Reply with quote

In der Manpage von Bash stehen so Sachen auch drin. Da kann man manchmal ganz gut nachsehen, wenn man wieder irgendwelche komischen Sachen in Scripts findet :)

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