On Sunday 29 February 2004 23:15, Ekkard Gerlach wrote:
Hallo,
was ist besser: [...] >/dev/null 2>&1 oder [...] 2>&1 >/dev/null?
Beides funktioniert ja scheinbar.
Ja, aber: folgendes Skript: --- cut here --- #!/bin/bash printf "Standardout\n" >&1 printf "Standarderror\n" >&2 --- cut here gibt auf stdout und stderr was aus. Der Test: pc121353:~ # ./script.sh 2>&1 1>test1 Standarderror pc121353:~ # more test1 Standardout pc121353:~ # Durch diesen Aufruf wird also nur Standardout in die Datei geleitet. Was über Standarderror rausgeht, kommt am Schirm an. pc121353:~ # ./script.sh 1>test1 2>&1 pc121353:~ # more test1 Standardout Standarderror pc121353:~ # Hier dagegen wird beides in die Datei geschickt.. Andreas PS: Früher konnte ich das auch mal erklären!