Manfred Lotz <manfred.lotz(at)web.de> wrote:
> somescript.sh:
> #! /bin/sh
> while [ true ];do
Interessante Art, 'ne Endlosschleife zu machen. :-)
> sleep 5
> done
>
> Das interessante ist, dass dieses Skript überhaupt nichts ausgibt. Es
> werden aber die Filedescriptoren wohl auf jeden Fall aufgemacht?!
Ja, per Default hast Du immer stdin/stdout/stderr. Ob das
Skript etwas ausgeben wird oder nicht, kann die Shell ja
nicht wissen, die den Prozeß forkt und dabei stdin etc.
verbindet. Außerdem kann es theoretisch immer passieren,
daß etwas schiefgeht und eine Ausgabe auf stderr kommt.
> > $ ssh ... 'somescript.sh </dev/null >logfile 2>&1 &'
>
> Funktioniert in der Tat mit der obigen Testkonstellation.
>
> > oder:
> >
> > $ ssh ... 'somescript.sh </dev/null 2>&1 | mail -s "Log" dich(at)domain &'
>
> Diese Version hängt bis ich das Skript auf dem anderen System platt
> mache.
Ja, kleine Auslassung meinerseits, die Nicolas ja bereits
korrigiert hat. Das hat man davon, wenn man nicht alles
selbst ausprobiert, was man aus dem Ärmel schüttelt. :-)
Gruß
Olli
-- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "C++ is the only current language making COBOL look good." -- Bertrand Meyer To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org with "unsubscribe de-bsd-questions" in the body of the messageReceived on Wed 17 Mar 2004 - 11:21:21 CET