Re: stty: stdin isn't a terminal

From: Bernd Walter <ticso(at)cicely9.cicely.de>
Date: Sun, 1 Sep 2002 10:29:25 +0200

On Sun, Sep 01, 2002 at 06:26:44AM -0000, Clemens Hermann wrote:
> Guten Morgen,
>
> folgendes möchte ein rc-script zum Starten von jails werden:
>
> <------------------ snip -------------------->
> #!/bin/sh
> cat /usr/local/etc/jails.conf |
> while read dir name ip
> do
> jail ${dir} ${name} ${ip} /bin/sh /etc/rc
> done
> exit 0
> <------------------ snip -------------------->
>
> es funktioniert soweit alles, nur dass ich als erste Meldung (bevor die
> Startmeldungen vom Jail kommen) ein "stty: stdin isn't a terminal" erhalte.
> Das Problem scheint irgendwie mit der pipe von cat zusammenzuhängen.

While ist ein Shell interner Befehl und läuft mit dem Shell Prozess.
Dementsprechend kann dann auch stdin nicht umgelenkt werden.
Du kannst allerdings die Schleife in eine Subshell legen und in die
Subshell Pipen:
#! /bin/sh
cat /usr/local/etc/jails.conf |
(
        while read dir name ip
        do
                jail ${dir} ${name} ${ip} /bin/sh /etc/rc
        done
)
exit 0

-- 
B.Walter              COSMO-Project         http://www.cosmo-project.de
ticso(at)cicely.de         Usergroup           info(at)cosmo-project.de
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sun 01 Sep 2002 - 10:29:58 CEST

search this site