[unix-ws] Shell Problem

Andreas Sindermann sinder at thp.Uni-Koeln.DE
Don Jan 13 15:11:10 CET 2000


Thomas Lange writes:
 > 
 > Folgendes Problem. Ich moechte in einer shell mehrere Kommandos
 > ausfuehren und deren output gemeinsam umlenken aber darin eine
 > Variabel setzen. Hier  zwei versionen
 > 
 > A:
 > #! /bin/sh
 > 
 > { export t=9 } |grep xxx
 > echo t= $t

Das ist kein redirecten, sondern eine pipe. Dar"uber steht in der
manpage:

          Each command in a pipeline is executed as a separate process
          (i.e. in a subshell).

Voila 8-)

Gr"u"se,
Andreas